Skip to content

Instantly share code, notes, and snippets.

@silgon
Created November 15, 2017 16:17
Show Gist options
  • Save silgon/49afe1f0ff82e26a18709d454eb55492 to your computer and use it in GitHub Desktop.
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)
#! /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