From 9b97d42f31d812e50ef82256b35afb1e2a785d89 Mon Sep 17 00:00:00 2001 From: gitea Date: Fri, 1 Sep 2023 17:20:23 +0800 Subject: [PATCH] [modify] fix logo number error --- update/nav_rand_logo.sh | 3 +++ 1 file changed, 3 insertions(+) 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.'