From 77dea1fcacd993e58e338138f690a16389a99c76 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Thu, 30 Jul 2015 14:20:56 +0200 Subject: [PATCH] reset counter after updating index --- update-index.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update-index.sh b/update-index.sh index f306eaa..25bcf9d 100755 --- a/update-index.sh +++ b/update-index.sh @@ -29,7 +29,7 @@ if [ ! -e config.cfg ]; then echo "Missing config.cfg file. Edit and rename conf source config.cfg number="98" -while [ $number != "99" ] +while [ "$number" != "99" ] do if [ "$1" == "" ]; then for ((i = 0; i < ${#NAME[*]}; i++)); do @@ -45,7 +45,7 @@ do if [ "$number" == 99 ]; then echo "Update canceled." - exit 1 + exit 0 fi CURNAME=${NAME[$number]} @@ -55,6 +55,7 @@ do rm sites/"$CURHOST".orig fi wget -q -T 5 -t 2 -U $(cat monitor-user-agent.txt) -O sites/"$CURHOST".orig http://"$CURHOST" + sed -i -e "s/ERROR\[$number\]=.*$/ERROR\[$number\]=0/g" $COUNTFILE echo "[INFO] Successfully updated $CURNAME ($CURHOST). Enter another host to update or cancel with 99." echo done