wake the fileserver on resume from sleep
#1
I have a windows file server that hosts all my media.
running xbmc 9.11 alpha2 and kind of a linux noob. i was wondering what would be the simplest way to make xbmc or the operating system itself send a magic packet to the file server for it to wake up as soon as system is booted or resumed from sleep.
Reply
#2
ok, so far got wol to work on a full system restart. so if I completly reboot the XBMC box it will wake my file server but can't get it to work on wakeup.

if anyone is interested this is how i got it working,

first install etherwake
Code:
sudo apt-get install etherwake

add the following line to rc.local file in /etc/

Code:
sudo etherwake FILE_SERVER_MAC_ADDRESS

all i need to make it work on wake up is to have that command executed on resume. I have tried a few samples online but none of them seem to work with ubuntu 9.10.
Reply
#3
You should be able to add the etherwake command to your resume script

This is untested but something along the lines of the following should work.

Add the following code block to /etc/pm/sleep.d/99lirc-resume.sh

Code:
#!/bin/sh

# This script will execute the etherwake command when the system resumes
# Remember to change FILE_SERVER_MAC_ADDRESS with the computers mac address
# When finished, it reports to /tmp/script.log.  This script goes in /etc/pm/sleep.d/99lirc-resume.sh  

case "$1" in
    resume)
        etherwake [b]FILE_SERVER_MAC_ADDRESS[/b]
        echo "etherwake resume script completed" >>/tmp/script.log
    ;;
esac

Don't forget to to change FILE_SERVER_MAC_ADDRESS with the actual mac address of the computer you want to wake up.
Reply
#4
ingeo Wrote:You should be able to add the etherwake command to your resume script

This is untested but something along the lines of the following should work.

Add the following code block to /etc/pm/sleep.d/99lirc-resume.sh

Code:
#!/bin/sh

# This script will execute the etherwake command when the system resumes
# Remember to change FILE_SERVER_MAC_ADDRESS with the computers mac address
# When finished, it reports to /tmp/script.log.  This script goes in /etc/pm/sleep.d/99lirc-resume.sh  

case "$1" in
    resume)
        etherwake [b]FILE_SERVER_MAC_ADDRESS[/b]
        echo "etherwake resume script completed" >>/tmp/script.log
    ;;
esac

Don't forget to to change FILE_SERVER_MAC_ADDRESS with the actual mac address of the computer you want to wake up.


it works perfectly, all I had to tweak was add a sudo to the beginning of etherwake so 'sudo etherwake FILE_SERVER_MAC_ADDRESS'

and change the permission on the file to 775.

Code:
sudo chmod 755 99lirc-resume.sh
Reply
#5
Or use a python script from here http://gsd.di.uminho.pt/jpo/software/wak...python.txt and run it from the XBMC Scripts menu.
Reply

Logout Mark Read Team Forum Stats Members Help
wake the fileserver on resume from sleep0