My ping command (on Debian 6 or 7) will repeatedly attempt to ping a server even while the network is down, if the network was up when it was started. Is there some way to start ping while the network is down and get this same behavior?
Here's an example. If I start a repeating ping while the network is up, and while the ping is running, the network goes down, the ping continues to repeat. If the network comes back up, it will continue pinging:
me@here:~$ ping -n 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=46 time=117 ms
...
64 bytes from 8.8.8.8: icmp_req=6 ttl=46 time=116 ms
ping: sendmsg: Network is unreachable
...
ping: sendmsg: Network is unreachable
64 bytes from 8.8.8.8: icmp_req=108 ttl=46 time=694 ms
...
However, if the network is down when I run ping:
me@here:~$ ping -n 8.8.8.8
connect: Network is unreachable
me@here:~$
This is the same unreachable network problem, but ping doesn't keep trying until the network is up again, like it had before.