czf4bfu |
Subversion Repositories: |
Rev 14 | Rev 15 | |
---|---|---|
Line 4... | Line 4... | |
# by Unreal][ |
# by Unreal][ | |
# verze 1.5 |
# verze 1.6 | |
# |
# | |
# 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' | |
# ip adresa nebo DNS zaznam serveru |
### MYIP - ip adresa nebo DNS zaznam serveru | |
MYIP='czf4bfu.kobylisy.czf' |
MYIP='czf4bfu.kobylisy.czf' | |
# server s aktualnim seznamem rozcestniku (bez http://) ... /servers.list |
### LIST - server s aktualnim seznamem rozcestniku (bez http://) ... /servers.list | |
LIST='www.jklir.net' |
LIST='www.jklir.net' | |
# |
| |
########################################################################################### | ||
| ||
cd $DATADIR |
cd $DATADIR | |
# stahneme si aktualni servers.list |
# stahneme si aktualni servers.list | |
if wget -T 3 -t 3 -N http://$LIST/servers.list |
if wget -T 3 -t 3 -N http://$LIST/servers.list | |
then |
then | |
echo "*** podarilo se ziskat servers.list z $LIST ***" |
echo "*** podarilo se ziskat servers.list z $LIST ***" | |
else |
else | |
echo "*** servers.list z $LIST nelze stahnout, pracuju se starym seznamem... ***" |
echo "*** servers.list z $LIST nelze stahnout, pracuju se starym seznamem... ***" | |
fi |
fi | |
for IP in `cat servers.list` |
||
do |
||
if [ $IP != $MYIP ]; |
||
then |
||
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/czf4bfu/global-$IP.txt |
||
then |
||
echo "*** podarilo se ziskat global-$IP.txt z $IP ***" |
||
else |
||
echo "*** zkousim jine servery na global-$IP.txt... *** " |
||
PRESKOC=0 |
||
for SERVER in `cat servers.list` |
||
do |
||
if [ $SERVER != $MYIP ]; |
||
then |
||
if [ $PRESKOC -lt 1 ]; |
||
then |
||
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/global-$IP.txt |
||
then |
||
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" |
||
PRESKOC=1 |
||
fi |
||
fi |
||
fi |
||
done |
||
fi |
||
fi |
||
done |
||
|
| |
# |
for IP in `cat servers.list` | |
# zkontrolujeme, jestli neni nejaky global navic |
do | |
# |
if [ $IP != $MYIP ]; then | |
ls global-*.txt | sed 's/^global-//' | sed 's/\.txt$//' > temp.list |
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/czf4bfu/global-$IP.txt | |
for TMPSVR in `cat temp.list` |
then | |
do |
echo "*** podarilo se ziskat global-$IP.txt z $IP ***" | |
OBSAHUJE=$(cat servers.list | grep $TMPSVR | wc -l) |
else | |
if [ $OBSAHUJE != "0" ] |
echo "*** zkousim jine servery na global-$IP.txt... *** " | |
then |
PRESKOC=0 | |
echo "*** $TMPSVR ok ***" |
for SERVER in `cat servers.list` | |
else |
do | |
if [ $TMPSVR != $MYIP ] |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then | |
then |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/global-$IP.txt | |
mv ./global-$TMPSVR.txt ./global-$TMPSVR.txt.bckp |
then | |
echo "*** $TMPSVR NEnalezen v servers.list a byl zalohovan ***" |
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" | |
fi |
PRESKOC=1 | |
fi |
fi | |
done |
fi | |
rm ./temp.list |
done | |
fi | ||
fi | ||
done | ||
| ||
### zkontrolujeme, jestli neni nejaky global navic | ||
| ||
GLOBALS=`ls global-*.txt | sed 's/^global-//' | sed 's/\.txt$//'` | ||
for TMPSVR in $GLOBALS | ||
do | ||
OBSAHUJE=$(cat servers.list | grep $TMPSVR | wc -l) | ||
if [ $OBSAHUJE != "0" ] | ||
then | ||
echo "*** $TMPSVR OK ***" | ||
else | ||
if [ $TMPSVR != $MYIP ]; then | ||
mv ./global-$TMPSVR.txt ./global-$TMPSVR.txt.bckp | ||
echo "*** $TMPSVR NEnalezen v servers.list a byl zalohovan ***" | ||
fi | ||
fi | ||
done | ||
|
|