Created
March 22, 2016 16:52
-
-
Save n7st/0cb0b9cb4fc549c40b8a to your computer and use it in GitHub Desktop.
Script to put on crontab. Wakes a server if IP provided as parameter (e.g. 192.168.1.98) is currently connected to the network.
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
#!/usr/bin/env bash | |
# $1 should be an IP address | |
/usr/sbin/arp -d $1 > /dev/null 2>&1; | |
/usr/bin/arp-scan -l > /dev/null 2>&1; | |
[[ $(/usr/sbin/arp -n $1 | grep "ether") ]] && /usr/sbin/etherwake -b ETHERNET_ADDRESS_OF_SERVER_HERE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment