Home > helpdesk > Build your own Wake-On-Lan script in Python

Build your own Wake-On-Lan script in Python

November 13th, 2008 niels

You need some simple way to wake up another computer? And you have Python at your disposal?
Great! All you need is this tiny script:

#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xff'*6+'\xaa\xbb\xcc\xdd\xee\xff'*16, ('172.31.3.33', 80))
print "sent wake up call to server..."

Substitute the aa, bb, … , ff with the MAC adress of your target, and use the correct IP adress.
That’s all :)

———-
Comments are disabled due to spamming.

Tags:
Comments are closed.