Update repos for Packet Squirrel Mk 2 release

This commit is contained in:
Mike Kershaw / Dragorn
2023-07-24 14:58:18 -04:00
parent 2181bf89e5
commit d3250b4165
56 changed files with 731 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/python
import sys
import socket
# Simplified function to send a wake-on-lan packet
def send_wol(destination):
sync = "FF" * 6
macs = destination * 16
payload = bytes.fromhex(sync + macs)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(payload, ("255.255.255.255", 9))
# Send a WoL packet for each MAC address we
# were called with
for mac in sys.argv[1:]:
fin_mac = mac.replace(":", "")
send_wol(fin_mac)