Re: internet connection tester script

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

 



kellyremo <kellyremo <at> zoho.com> writes:

> ... 
> 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?
> ...

Test:

1. there is internet connection to both

$ TORF=true; 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; echo $TORF; sleep 1;
done
false
$

2. there is no internet connection to at least one

$ TORF=true; while $TORF; do ping -W 1 -c 1 www.blakstar.org >& /dev/null &&
ping -W 1 -c 1 www.yahoo.com >& /dev/null && TORF=false || TORF=true; echo
$TORF; sleep 1; done
true
true
true
true
^C
$

Nota bene !
Let's assume negation is represented by "~" sign.
~(a && b) equivalent to ~a || ~b
~(a || b) equivalent to ~a && ~b

JB

 




-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux