initial commit v1.0

This commit is contained in:
2014-12-08 16:04:37 +01:00
commit 05a4cc2cd3
7 changed files with 801 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")"
# Test if config.cfg exists and set needed variables
if [ ! -e config.cfg ]; then echo "Missing config.cfg file. Edit and rename config.cfg.sample"; exit 1; fi
source config.cfg
if [ "$1" == "" ]; then
for ((i = 0; i < ${#NAME[*]}; i++)); do
echo "$i. ${NAME[$i]} ${HOST[$i]}"
done
echo "99. Cancel update"
read -p "Which host's original index site should be updated? " number
else
number="$1"
fi
if [ "$number" == 99 ]; then
echo "Update canceled."
exit 1
fi
CURNAME=${NAME[$number]}
CURHOST=${HOST[$number]}
if [ -e sites/"$CURHOST".orig ]; then
rm sites/"$CURHOST".orig
fi
wget -q -T 5 -t 2 -U $(cat monitor-user-agent.txt) -O sites/"$CURHOST".orig http://"$CURHOST"