czf4bfu |
Subversion Repositories: |
Rev 20 | Rev 21 | |
---|---|---|
Line 4... | Line 4... | |
# by Unreal][ |
# by Unreal][ | |
# verze 1.8 |
# verze 1.9 | |
# |
# | |
### 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' | |
### LIST - server s aktualnim seznamem rozcestniku (bez http://) ... /servers.list |
### LIST - server s aktualnim seznamem rozcestniku | |
LIST='www.jklir.net' |
LIST='http://www.jklir.net/servers.list' | |
|
| |
########################################################################################### |
########################################################################################### | |
|
| |
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 $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 | |
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 | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$IP/global-$IP.txt |
if wget -T 2 -t 2 -N -U CZF4BFU http://$IP/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... *** " |
echo "*** zkousim jine servery na global-$IP.txt... *** " | |
PRESKOC=0 |
PRESKOC=0 | |
for SERVER in `cat servers.list` |
for SERVER in `cat servers.list` | |
do |
do | |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/czf4bfu/global-$IP.txt |
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 |
||
else |
||
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/global-$IP.txt |
||
then |
then | |
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" |
echo "***** podarilo se ziskat global-$IP.txt z $SERVER *****" | |
PRESKOC=1 |
PRESKOC=1 | |
fi |
fi | |
fi |
fi | |
fi |
done | |
done |
||
fi |
fi | |
fi |
fi | |
fi |
fi | |
done |
done | |
|
| |
### zkontrolujeme, jestli neni nejaky global navic |
### zkontrolujeme, jestli neni nejaky global navic | |
|
| |
Line 79... | Line 73... | |
for TMPSVR in $GLOBALS |
for TMPSVR in $GLOBALS | |
do |
do | |
for ICONS in `grep 'ICON:' global-$TMPSVR.txt`; do |
for ICONS in `grep 'ICON:' global-$TMPSVR.txt`; do | |
ICONURL=`echo "$ICONS" | sed -n "s/^ICON: \([[:space:]]+\)\?\([^[:space:]#].*\)/\2/p"` |
ICONURL=`echo "$ICONS" | sed -n "s/^ICON: \([[:space:]]+\)\?\([^[:space:]#].*\)/\2/p"` | |
ICONNAME=`echo "$ICONURL" | sed -n "s/^\(.*\)\/\([^[\/].*\)$/\2/p"` |
ICONNAME=`echo "$ICONURL" | sed -n "s/^\(.*\)\/\([^[\/].*\)$/\2/p"` | |
if [ "$ICONNAME" != "" ]; then |
if [ "$ICONNAME" != "" ] && [ ! -f "$DATADIR"/"$TMPSVR"_"$ICONNAME" ]; then | |
if wget -T 3 -t 3 -N -U CZF4BFU $ICONURL |
if wget -T 3 -t 3 -N -U CZF4BFU $ICONURL | |
then |
then | |
mv $ICONNAME $DATADIR/cache/"$TMPSVR"_"$ICONNAME" |
mv $ICONNAME $DATADIR/cache/"$TMPSVR"_"$ICONNAME" | |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $TMPSVR *****" |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $TMPSVR *****" | |
else |
else | |
PRESKOC=0 |
PRESKOC=0 | |
for SERVER in `cat servers.list` |
for SERVER in `cat servers.list` | |
do |
do | |
if [ $PRESKOC -lt 1 ]; then |
if [ $SERVER != $MYIP ] && [ $PRESKOC -lt 1 ]; then | |
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/"$TMPSVR"_"$ICONNAME" | |
then |
then | |
mv "$SERVER"_"$ICONNAME" $DATADIR/cache/"$SERVER"_"$ICONNAME" |
mv "$TMPSVR"_"$ICONNAME" $DATADIR/cache/"$TMPSVR"_"$ICONNAME" | |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" | |
PRESKOC=1 |
PRESKOC=1 | |
else |
else | |
if wget -T 3 -t 3 -N -U CZF4BFU http://$SERVER/cache/"$SERVER"_"$ICONNAME" |
if wget -T 2 -t 2 -N -U CZF4BFU http://$SERVER/cache/"$TMPSVR"_"$ICONNAME" | |
then |
then | |
mv "$SERVER"_"$ICONNAME" $DATADIR/cache/"$SERVER"_"$ICONNAME" |
mv "$TMPSVR"_"$ICONNAME" $DATADIR/cache/"$TMPSVR"_"$ICONNAME" | |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" |
echo "***** podarilo se stahnout ikonku $ICONNAME ze serveru $SERVER *****" | |
PRESKOC=1 |
PRESKOC=1 | |
fi |
fi | |
fi |
fi | |
fi |
fi | |
done |
done | |
fi |
fi | |
fi |
fi |