Wake On Lan implementation

I recently updated my nas to 10-1 (SPD8020), however in the process I lost my WOL script :(. I'm currently on the fence about keeping this NAS in operation anyway to be fair (have an Athlon X3 8650 system doing nothing, so possibly putting that into good use with the 500GB disk from the 8020), but loosing this script is really too bad. I've always used the NAS to SSH into my home network and wake my home system in order to work there. Sadly I did not backup the script however (I have a dd from the partitions but I have no clue if my script was on there). I believe it was a modifcation of this script:
http://www.hackernotcracker.com/2006-04 ... cript.html
or this one
But it's been over 2 and half years since I made/modified it all for use so I am unsure. I do think however that an implementation of WOL on the NAS would be a nice addition for many people to keep it functional as gatekeeper/off-site backup. Generating the script wasn't all that much work (if I was able to do it ;)) and adding it to the interface should also not be too hard (aside from possibly always requiring root). Just a suggestion :).
P.S. Sorry I lost my script, would have loved to share!!! It ran on 4.2 fvdw
http://www.hackernotcracker.com/2006-04 ... cript.html
or this one
- Code: Select all
<?
function WakeOnLan($ip, $mac, $port)
{
$packet = "";
for($i = 0; $i < 6; $i++) $packet .= chr(0xFF);
for($i = 0; $i < 6; $i++) $packet .= chr((int)substr($mac, $i, $i +
2));
$nic = fsockopen("udp://" . $ip, $port));
if($nic==false){
return false;
fclose($nic);
}
fwrite($nic, $packet);
fclose($nic);
return true;
}
?>
But it's been over 2 and half years since I made/modified it all for use so I am unsure. I do think however that an implementation of WOL on the NAS would be a nice addition for many people to keep it functional as gatekeeper/off-site backup. Generating the script wasn't all that much work (if I was able to do it ;)) and adding it to the interface should also not be too hard (aside from possibly always requiring root). Just a suggestion :).
P.S. Sorry I lost my script, would have loved to share!!! It ran on 4.2 fvdw