czf4bfu |
Subversion Repositories: |
Rev 18 | Rev 20 | |
---|---|---|
Line 4... | Line 4... | |
# by Unreal][ |
# by Unreal][ | |
# verze 1.7 |
# verze 1.8 | |
# |
# | |
### DATADIR - adresar kam se maj ukladat soubory se zdroji (nejcasteji '/var/www/czf4bfu') |
### DATADIR - adresar kam se maj ukladat soubory se zdroji (nejcasteji '/var/www/czf4bfu') | |
DATADIR='/var/www/www.kobylisy.czf/czf4bfu' |
DATADIR='/var/www/www.kobylisy.czf/czf4bfu' | |
### MYIP - ip adresa nebo DNS zaznam serveru |
### MYIP - ip adresa nebo DNS zaznam serveru | |
MYIP='czf4bfu.kobylisy.czf' |
MYIP='czf4bfu.kobylisy.czf' | |
Line 27... | Line 27... | |
if [ $IP != $MYIP ]; then |
if [ $IP != $MYIP ]; then | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/czf4bfu/global-$IP.txt |
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/czf4bfu/global-$IP.txt | |
then |
then | |
echo "*** podarilo se ziskat global-$IP.txt z $IP ***" |
echo "*** podarilo se ziskat global-$IP.txt z $IP ***" | |
else |
else | |
echo "*** zkousim jine servery na global-$IP.txt... *** " |
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/global-$IP.txt | |
PRESKOC=0 |
then | |
for SERVER in `cat servers.list` |
echo "*** podarilo se ziskat global-$IP.txt z $IP ***" | |
do |
else | |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then |
echo "*** zkousim jine servery na global-$IP.txt... *** " | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/global-$IP.txt |
PRESKOC=0 | |
then |
for SERVER in `cat servers.list` | |
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" |
do | |
PRESKOC=1 |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then | |
fi |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/global-$IP.txt | |
fi |
then | |
done |
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" | |
PRESKOC=1 | ||
else | ||
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/global-$IP.txt | ||
then | ||
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" | ||
PRESKOC=1 | ||
fi | ||
fi | ||
fi | ||
done | ||
fi | ||
fi |
fi | |
fi |
fi | |
done |
done | |
|
| |
### zkontrolujeme, jestli neni nejaky global navic |
### zkontrolujeme, jestli neni nejaky global navic | |
Line 83... | Line 94... | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/cache/"$SERVER"_"$ICONNAME" |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/cache/"$SERVER"_"$ICONNAME" | |
then |
then | |
mv "$SERVER"_"$ICONNAME" $DATADIR/cache/"$SERVER"_"$ICONNAME" |
mv "$SERVER"_"$ICONNAME" $DATADIR/cache/"$SERVER"_"$ICONNAME" | |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" | |
PRESKOC=1 |
PRESKOC=1 | |
else | ||
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/cache/"$SERVER"_"$ICONNAME" | ||
then | ||
mv "$SERVER"_"$ICONNAME" $DATADIR/cache/"$SERVER"_"$ICONNAME" | ||
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" | ||
PRESKOC=1 | ||
fi | ||
fi |
fi | |
fi |
fi | |
done |
done | |
fi |
fi | |
fi |
fi |