WOL Script

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
marksoccer
DD-WRT Novice


Joined: 08 Feb 2008
Posts: 21

PostPosted: Wed Mar 19, 2008 4:32    Post subject: WOL Script Reply with quote
I recently discovered how awesome WOL is, but it is a real pain entering/remembering "/usr/sbin/wol -i [ip address] [mac address]" I always start the same computer (my desktop) so I always use the exact same command. Is there a way I can hardcode my router so that as soon as I ssh in, all I have to do is type "desktop"? I did see a WOL script that I put into the startup script for my router, but it didnt work the way I thought and it still had a longer command than "desktop." Is this possible? I would greatly appreciate any help.
Sponsor
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Wed Mar 19, 2008 4:42    Post subject: Reply with quote
Enter the commands into a script named desktop.sh

cd /tmp

echo "/usr/sbin/wol -i [ip address] [mac address]" > desktop.sh


chmod it as executable

chmod +x desktop.sh

Then run it

./desktop.sh

BTW, if you save WOL command in the web gui as custom script, you can run it by typing ./custom.sh instead. That script will remain even after reboot, but desktop.sh will not.
marksoccer
DD-WRT Novice


Joined: 08 Feb 2008
Posts: 21

PostPosted: Wed Mar 19, 2008 5:19    Post subject: Reply with quote
Thanks for the quick reply. That worked great, except that the command is "sh ../custom.sh" to run the custom script from ssh. thanks
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Wed Mar 19, 2008 5:26    Post subject: Reply with quote
Glad to help. :)

The command really depends on what directory you're in, and if script was chmod +x or not.

Most of the time I just do ./scriptname from the same directory the script is in.
marksoccer
DD-WRT Novice


Joined: 08 Feb 2008
Posts: 21

PostPosted: Wed Mar 19, 2008 5:30    Post subject: Reply with quote
I see, thanks again Very Happy
deepdvd
DD-WRT Novice


Joined: 04 May 2009
Posts: 3

PostPosted: Mon May 04, 2009 21:22    Post subject: Reply with quote
This is a great idea, but /tmp is removed after a router reboot, so if the power goes out, you'll have to type the whole thing.

Edit: Nevermind, I missed this part.
soulstace wrote:
BTW, if you save WOL command in the web gui as custom script, you can run it by typing ./custom.sh instead. That script will remain even after reboot, but desktop.sh will not.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum