I want to write a script, that would keep checking if any of the devices in network, that should be online all day long, are really online. I tried to use ping, but
There is advanced version of ping - "fping", which gives possibility to define the timeout in milliseconds.
#!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi