I needed a way to wake up my server when I was away.  I don’t like to keep it running all day, so Wake-On-Lan was the solution for me.  I run DD-WRT as the Firmware on my router, so I knew that I could write some kind of script for it to do that for me.  Since DD-WRT already includes a Wake-On-Lan binary, I searched the DD-WRT site, and found a script that is supposed to do WOL, but it didnt really work, so I borrowed the Idea, and created my own:

Update [08/2012]:
DD-WRT now requires you to add “#!/bin/sh” to the beginning of every script, so I updated the Script Accordingly!!

Once you get the script into your router, to use it, all you have to do is type “./wol.sh <servername> and the script will handle the rest

This script looks at your dnsmasq.conf file, so if you have a DHCP reservation for your server like I do, it should be included in this file as a “static” ip adress, along with the MAC address, which is what you really need for WOL to work

Facebook Twitter Email Linkedin Digg Delicious