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