Created
January 10, 2023 17:39
-
-
Save vagelim/d80ae2b4d0a0a5a9d77b52b32fee5c40 to your computer and use it in GitHub Desktop.
nc for wol
This file contains hidden or 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 | |
#replace MAC value with NIC MAC | |
MAC=11:22:33:44:55:66 | |
echo -e $(echo $(printf 'f%.0s' {1..12}; printf "$(echo $MAC | sed 's/://g')%.0s" {1..16}) | sed -e 's/../\\x&/g') | nc -w1 -u -b 255.255.255.255 4000 | |
# from https://stackoverflow.com/questions/31588035/bash-one-line-command-to-send-wake-on-lan-magic-packet-without-specific-tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment