mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-08-04 03:05:13 -04:00
10 lines
220 B
Python
10 lines
220 B
Python
import ipaddress
|
|
|
|
import wakeonlan
|
|
|
|
|
|
def wake(mac, ip, netmask):
|
|
subnet = ipaddress.ip_network(
|
|
f"{ip}/{netmask}", strict=False).broadcast_address
|
|
wakeonlan.send_magic_packet(mac, ip_address=str(subnet))
|