<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tyk.wiki/index.php?action=history&amp;feed=atom&amp;title=Tykwol</id>
	<title>Tykwol - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tyk.wiki/index.php?action=history&amp;feed=atom&amp;title=Tykwol"/>
	<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Tykwol&amp;action=history"/>
	<updated>2026-05-10T14:20:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://tyk.wiki/index.php?title=Tykwol&amp;diff=306&amp;oldid=prev</id>
		<title>Tykling: Created page with &#039;&lt;pre&gt; #!/usr/local/bin/python #################################################################################### # tykwol.py # This is a wake-on-lan magic packet sender written…&#039;</title>
		<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Tykwol&amp;diff=306&amp;oldid=prev"/>
		<updated>2010-07-28T14:49:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;lt;pre&amp;gt; #!/usr/local/bin/python #################################################################################### # tykwol.py # This is a wake-on-lan magic packet sender written…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/local/bin/python&lt;br /&gt;
####################################################################################&lt;br /&gt;
# tykwol.py&lt;br /&gt;
# This is a wake-on-lan magic packet sender written in python and scapy. I wrote it&lt;br /&gt;
# because I couldn&amp;#039;t find any WOL tools that allows the user to specify interface&lt;br /&gt;
# on a multi homed box, when broadcasting the WOL magic packet. This script takes a&lt;br /&gt;
# mac address and an interface as arguments, and sends the magic packet out the&lt;br /&gt;
# specified interface to wake the machine with the specified mac. It is an extension&lt;br /&gt;
# of the WOL example in the Scapy documentation.&lt;br /&gt;
#&lt;br /&gt;
# This script requires:&lt;br /&gt;
# - Python - http://www.python.org/ - /usr/ports/lang/python26 on FreeBSD&lt;br /&gt;
# - Scapy - http://www.secdev.org/projects/scapy/ - /usr/ports/net/scapy on FreeBSD&lt;br /&gt;
#&lt;br /&gt;
#                                 /Tykling &amp;lt;tykling@gmail.com&amp;gt; - v1.0 december 2009&lt;br /&gt;
####################################################################################&lt;br /&gt;
&lt;br /&gt;
#import needed modules&lt;br /&gt;
import sys&lt;br /&gt;
from scapy.all import *&lt;br /&gt;
&lt;br /&gt;
#check number of arguments&lt;br /&gt;
if len(sys.argv) != 3:&lt;br /&gt;
  sys.exit(&amp;quot;Usage: &amp;quot; + sys.argv[0] + &amp;quot; em0 1234567890ab    - where em0 is the interface and 1234567890ab is the mac address to wake up.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#set variables&lt;br /&gt;
ifc = sys.argv[1]&lt;br /&gt;
hexmac = sys.argv[2]&lt;br /&gt;
&lt;br /&gt;
#remove colon from the mac&lt;br /&gt;
hexmac = hexmac.replace(&amp;quot;:&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#remove dot from the mac (thanks cisco)&lt;br /&gt;
hexmac = hexmac.replace(&amp;quot;.&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#remove dashes from the mac (thanks microsoft)&lt;br /&gt;
hexmac = hexmac.replace(&amp;quot;-&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#check length of the supplied mac address&lt;br /&gt;
if len(hexmac) != 12:&lt;br /&gt;
  sys.exit(&amp;quot;Mac address must be 12 digits - allowed seperators are colon (:) dash (-) and dot (.)!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#decode the hex mac address to ascii&lt;br /&gt;
mac = hexmac.decode(&amp;quot;hex&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#define the FF byte (the magic packet needs six FF bytes as padding in the beginning of the packet)&lt;br /&gt;
eff = &amp;#039;\xff&amp;#039;&lt;br /&gt;
&lt;br /&gt;
#the main procedure&lt;br /&gt;
def main():&lt;br /&gt;
        #build and send the magic packet&lt;br /&gt;
        sendp(Ether(dst=&amp;#039;ff:ff:ff:ff:ff:ff&amp;#039;) /IP(dst=&amp;#039;255.255.255.255&amp;#039;) /UDP(dport=9) /Raw(eff*6 + mac*16),iface=ifc)&lt;br /&gt;
        #a little output to the user&lt;br /&gt;
        print &amp;quot;Sent magic packet to&amp;quot;, hexmac, &amp;quot;on interface&amp;quot;, ifc&lt;br /&gt;
&lt;br /&gt;
#call the main procedure&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tykling</name></author>
	</entry>
</feed>