## mh-vr 141099 - konecne opraveno predavani parametru odkazem a smycka misto vyctu adres if [ "$1" == "-tty" ] ; then LOGFILE=/dev/tty else LOGFILE=/var/log/proxy.log fi if [ "$1" == "-log" ] ; then tail -n 20 -f $LOGFILE exit fi ANT="_adresa_anteny_" ANT_PR="_adresa_druhe_strany_anteny_" RTR_PR="_adresa_routeru_providera_" WWW_CZ="_adresa_nekde_v_cesku_" WWW_OUT="_adresa_neceho_uplne_jinde_" pingni() { KAM=$1 eval ADRESA=$`echo $KAM` echo -n " $KAM:" >> $LOGFILE VYSL=`ping -q -c 5 $ADRESA | grep " 100%" > /dev/null ; echo $?` ## pokud se vrati 0, je 100% paketu ztracenych :-( if [ "$VYSL" = "0" ] ; then echo -n "ERR" >> $LOGFILE else echo -n "OK" >> $LOGFILE fi } echo -n `date +"%d/%m/%Y %H:%M"` >> $LOGFILE for CIL in ANT ANT_PR RTR_PR WWW_CZ WWW_OUT ; do pingni $CIL done echo >> $LOGFILE