[modify] fix logo number error

This commit is contained in:
gitea 2023-09-01 17:20:23 +08:00
parent 42ec2ca2b7
commit 9b97d42f31

View File

@ -2,6 +2,9 @@
# 设置图片数量和输出文件名 # 设置图片数量和输出文件名
IMAGE_NUM_ALL=`ls /opt/websites/nav/assets/images/logos | wc -l` IMAGE_NUM_ALL=`ls /opt/websites/nav/assets/images/logos | wc -l`
# there are 221 logos in total, and index are from 0, so the max index is 220
# whhereas there has an avatar.jpg file in this dir, so need to subtract one
let IMAGE_NUM_ALL=IMAGE_NUM_ALL-1
IMAGE_NUM_NEEDED=`cat /opt/websites/nav/index.html | grep -E '[0-9]{1,3}.jpg' | wc -l` IMAGE_NUM_NEEDED=`cat /opt/websites/nav/index.html | grep -E '[0-9]{1,3}.jpg' | wc -l`
if [[ $IMAGE_NUM_NEEDED -gt $IMAGE_NUM_ALL ]]; then if [[ $IMAGE_NUM_NEEDED -gt $IMAGE_NUM_ALL ]]; then
alarm='Navigation:\nThere is NOT enough logos to use, please check ASAP.' alarm='Navigation:\nThere is NOT enough logos to use, please check ASAP.'