Works well for me, too :)
Thanks, Endo
________________________________
From: OpenTurbostation@yahoogroups.com [mailto:OpenTurbostation@yahoogroups.com] On Behalf Of endosoft_com
Sent: 16 April 2008 19:49
To: OpenTurbostation@yahoogroups.com
Subject: [OpenTurbostation] Re: Wake On LAN utility
Hi,
I had the same problem and solved it using the builtin python.
<code>
#!/mnt/ext/usr/bin/python
import socket, sys
def createmagicpacket(mac):
packet = "\xFF\xFF\xFF\xFF\xFF\xFF"
i = 16;
while (i):
packet+=mac
i-=1
return packet
host = '' # Bind to all interfaces
port = 51423
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((host, port))
s.connect(('192.168.178.255',10000))
wakeupmac=sys.argv[1]
s.send(createmagicpacket(wakeupmac))
s.close()
</code>
The MAC address has to be passed in this form
"\x01\x23\x45\x67\x89\xab".
In a php webpage it can be used like this
<code>
function wakeWithPython($host) {
exec('/path/to/your/pythonscript/wol.py '.$host,$output,$retval);
if ($retval == 0) {
echo $host. " is waking up";
} else {
echo $host. " not waken up";
}
}
</code>
Works well for me.
Greetings,
Endo
--- In OpenTurbostation@yahoogroups.com <mailto:OpenTurbostation%40yahoogroups.com> , "Ewald Muessig" <ewald@...>
wrote:
>
> Hi,
>
> I have a TS-101 and want to use it to wake my PC's via the web
browser.
>
> I found a php script using the "socket_create()" function but the
php
> from the TS-101 doesn't support that function.
>
> So I would like to know if any from has a command line tool for the
TS-
> 101 to send a WOL packet.
>
> Or, if any of you know how to enable the "socket_create()" function
on
> the built-in PHP.
>
>
> thanks!
> Ewald
>