From 2161908397fd2d432e2d1eae866c973ab3463676 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Thu, 16 Sep 2021 15:47:53 +0800 Subject: [PATCH] Add the progress log of sync --- scripts/check-image.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/check-image.sh b/scripts/check-image.sh index 0a6fc5b..b7d4a79 100755 --- a/scripts/check-image.sh +++ b/scripts/check-image.sh @@ -46,7 +46,10 @@ done LOGFILE="./check-image.log" echo >"${LOGFILE}" -for line in $(cat ./mirror.txt | shuf); do +count=0 +images="$(cat ./mirror.txt | tr -d ' ' | grep -v -E '^$' | grep -v -E '^#' | shuf)" +images_count=$(echo "${images}" | wc -l | tr -d ' ') +for line in ${images}; do line="${line/ /}" if [[ "$line" == "" ]]; then continue @@ -62,7 +65,8 @@ for line in $(cat ./mirror.txt | shuf); do domain="${line%%/*}" new_image=$(echo "${line}" | sed "s/^${domain}/${DOMAIN_MAP["${domain}"]}/g") - echo "Diff image ${line} ${new_image}" + count=$((count + 1)) + echo "Diff ${count}/${images_count} image ${line} ${new_image}" DEBUG="${DEBUG}" QUICKLY="${QUICKLY}" INCREMENTAL="${INCREMENTAL}" PARALLET="${PARALLET}" EXCLUDED="${exclude}" ./scripts/diff-image.sh "${line}" "${new_image}" 2>&1 | tee -a "${LOGFILE}" || { echo "Error: diff image ${line} ${new_image}" }