-1
votes
1answer
174 views

Bash Ping to return 'alive' IP addresses

(Disclaimer- I know this can be done more easily with nmap, but its supposed to be practice for bash shell scripting). $ scriptname 192.168.42 18 23 Checking: 192.168.42.18 19 20 21 22 23 Live ...
11
votes
3answers
1k views

How to redirect the output of any command?

I'm trying to write a simple script to monitor my network status, without all of ping's output: ping -q -c 1 google.com > /dev/null && echo online || echo offline The problem is that ...
2
votes
1answer
265 views

Suppress “Alarm clock: 14” from ping

I've made a simple script for rebooting my router and afterwards showing a progress bar until my computer has an internet connection again. When running the script I get the following output: The ...
0
votes
1answer
220 views

ping timeout differences between OS X and Linux/other OSs

This function I wrote should exemplify the idiosyncrasy between OSX and Linux ping commands, in particular their -W timeout option: # Checks if a host is up-and-running and responding to pings ...
1
vote
2answers
305 views

need portable crontab host-checking/failover logic across Linux & Cygwin

A host-ping test that always works correctly from the interactive bash command line in Cygwin, is behaving incorrectly in its own crontab--always selecting the second host--and I can't figure out why: ...