Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Wake a sleeping Mac from the network' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Wake a sleeping Mac from the network
Authored by: fladnag77 on Jan 30, '07 07:56:43AM

To get this script to work with the "broadcast" address (which is useful if you don't know the sleeping machine's IP (when it is dynamically assigned using eg DHCP)), I added one line:

#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto('\xff'*6+'\x00\x01\x02\x03\x04\x05'*16, ('192.168.1.255', 9))

and also changed the port to 9 (the "discard" port).



[ Reply to This | # ]