Created
November 15, 2017 16:17
-
-
Save silgon/49afe1f0ff82e26a18709d454eb55492 to your computer and use it in GitHub Desktop.
this script is a workaround for cronjob (because my router sometimes fails to interconnect my computers)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# this script is a workaround for cronjob (because my router sometimes fails to interconnect my computers) | |
ips=( "192.168.0.1" "192.168.0.2" "192.168.0.3" ) | |
for i in "${ips[@]}"; do | |
: | |
ping -c1 -W5 $i >/dev/null && echo $i' up' || echo $i' down' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment