Skip to content

Instantly share code, notes, and snippets.

@astail
Created June 16, 2015 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astail/bf7ee5572dd87ee98e23 to your computer and use it in GitHub Desktop.
Save astail/bf7ee5572dd87ee98e23 to your computer and use it in GitHub Desktop.
#!/bin/sh
ether-wake -i eth0 xx:xx:xx:xx:xx:xx
hostip=192.168.0.xx
set -eu
i=0
while true
do
if ping -c 1 $hostip >> /dev/null; then
break
fi
if [ $i -eq 5 ]; then
break
fi
sleep 10s
i=`expr $i + 1`
echo $i
done
echo ping ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment