reset counter after updating index

This commit is contained in:
2015-07-30 14:20:56 +02:00
parent 312803968a
commit 77dea1fcac
+3 -2
View File
@@ -29,7 +29,7 @@ if [ ! -e config.cfg ]; then echo "Missing config.cfg file. Edit and rename conf
source config.cfg source config.cfg
number="98" number="98"
while [ $number != "99" ] while [ "$number" != "99" ]
do do
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
for ((i = 0; i < ${#NAME[*]}; i++)); do for ((i = 0; i < ${#NAME[*]}; i++)); do
@@ -45,7 +45,7 @@ do
if [ "$number" == 99 ]; then if [ "$number" == 99 ]; then
echo "Update canceled." echo "Update canceled."
exit 1 exit 0
fi fi
CURNAME=${NAME[$number]} CURNAME=${NAME[$number]}
@@ -55,6 +55,7 @@ do
rm sites/"$CURHOST".orig rm sites/"$CURHOST".orig
fi fi
wget -q -T 5 -t 2 -U $(cat monitor-user-agent.txt) -O sites/"$CURHOST".orig http://"$CURHOST" 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 "[INFO] Successfully updated $CURNAME ($CURHOST). Enter another host to update or cancel with 99."
echo echo
done done