diff --git a/update/nav_rand_logo.sh b/update/nav_rand_logo.sh index cc5035c..92e598f 100644 --- a/update/nav_rand_logo.sh +++ b/update/nav_rand_logo.sh @@ -2,6 +2,9 @@ # 设置图片数量和输出文件名 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` if [[ $IMAGE_NUM_NEEDED -gt $IMAGE_NUM_ALL ]]; then alarm='Navigation:\nThere is NOT enough logos to use, please check ASAP.'