proc WoL { macAddr } { #after 60000 set net [binary format H* [join [split $macAddr -:] ""]] set pkt [binary format c* {0xff 0xff 0xff 0xff 0xff 0xff}] for {set i 0} {$i < 16} {incr i} { append pkt $net } # Open UDP and Send the Magic Paket. set udpSock [udp_open] fconfigure $udpSock -translation binary \ -remote [list 255.255.255.255 4580] \ -broadcast 1 puts $udpSock $pkt flush $udpSock; close $udpSock } if { $::argc > 0 } { set i 1 foreach arg $::argv { WoL $arg incr i } } puts "Magic packet was sent" #clock format [clock seconds] -format %B puts "[clock format [clock seconds]]" set fo [open flash:/eem/tcl_scripts/WoL.log "a+"] # fconfigure $fo -translation crlf # seek $fo 10 end puts $fo "" puts $fo "[clock format [clock seconds]]" # puts -nonewline $fo "Magic packet was sent" puts $fo "Magic packet was sent" puts $fo "\n" close $fo file copy -force flash:/tcl_scripts/WoL.log tftp://192.168.183.250/WoL.log