Re: internet connection tester script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Le ven 28 jan 2011 03:28:22 CET, kellyremo a écrit:

> [ ... ]
> $ while $TORF; do ping -W 1 -c 1 bix.hu >& /dev/null && ping -W 1 -c 1 www.yahoo.com >& /dev/null && TORF=false || TORF=true; done
> $ 
> 
> It just doesn't work. 
> 
> Goal: if theres no internet connection, then the oneliner must loop until there is internet connection. if theres internet connection the oneliner ends.
> 
> what am i missing?

try :
until ping -W 1 -c 1 bix.hu || ping -W 1 -c 1 www.yahoo.com ; do 
  sleep 5
done >& /dev/null

Note that ping -W 1 is crazy.

-- 
Philippe
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux