Skip to content

Instantly share code, notes, and snippets.

@trick77
Last active October 16, 2015 14:31
Show Gist options
  • Save trick77/49bcb6d9597f404beacd to your computer and use it in GitHub Desktop.
Save trick77/49bcb6d9597f404beacd to your computer and use it in GitHub Desktop.
Shell script which checks if network is up and wakes a WOL device using wakeonlan
#!/bin/sh
. /etc/rc.common
CheckForNetwork
while [ "${NETWORKUP}" != "-YES-" ]
do
sleep 1
NETWORKUP=
CheckForNetwork
done
/usr/local/bin/wakeonlan 00:08:9B:C5:BD:21 #<-- Enter NAS MAC address here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment