Skip to content

Instantly share code, notes, and snippets.

View weberax's full-sized avatar

Axel weberax

View GitHub Profile
@weberax
weberax / send-magic-packet.sh
Last active March 27, 2020 14:45 — forked from SteveMarshall/send-magic-packet.sh
Wake-On-Lan Magic Packet using netcat in bash
#!/usr/bin/env bash
[ -z "$1" ] && echo "usage: mac_address [broadcast_address] [port]" && exit 1
mac_address=$1
# Strip colons from the MAC address
mac_address=$(echo $mac_address | sed 's/[ :-]//g')
[ -z "$2" ] && broadcast="255.255.255.255" || broadcast=$2
[ -z "$3" ] && port=9 || port=$3