Page 1 of 1

Wake NAS when pressing NAS button

PostPosted: 14 Feb 2016, 12:35
by DerDicke
Hello,

my WakeOnLan only works, after pulling the power cord. I would like to wake my NAS, when pressing the NAS button on the remote. But I'm not familiar with linux at all.

Can somebody help me to make the code working? The wakelan.conf is correct, because after manual restarting the module my NAS wakes up. But to click through the entire ASUS menu is quite annoying.

What I have so far:
In irfake.conf
Code: Select all
"1","b24d686c","/usr/local/etc/mos/irfake/wake_DS212.sh &",   WOL DS212


In my wake_DS212.sh
Code: Select all
#!/bin/sh
#
# description: Wake DS212
#
mos=/usr/local/etc/mos

   # waiting valid IP address
   $mos/bin/wait_ip && exit 1

   echo "Send UDP packets..."

   # read config
   [ -f $mos/etc/wakelan.conf ] && eval "$( cat $mos/etc/wakelan.conf | sed '/^$/d' )"

   mac=${mac:-"00:11:22:33:44:55"}
   bcast=${bcast:-''}
   port=${port:-''}

   # running wakelan
   [ ! -z $mac   ] && m="-m $mac"
   [ ! -z $bcast ] && b="-b $bcast"
   [ ! -z $port  ] && p="-p $port"

   $mos/bin/wakelan $m $b $p
   ;;

exit $?


I copied the code form the S38wakelan. So far nothing happens. For a linux expert the easiest would be, just to restart the module/service/deamon, but I have no idea to do this.

Help is appreciated.

Re: Wake NAS when pressing NAS button

PostPosted: 14 Feb 2016, 14:01
by Virtual
irfake.conf
Code: Select all
"1","b24d686c","/bin/sh -c /usr/local/etc/mos/irfake/wake_DS212.sh &",   WOL DS212

но проще так:
Code: Select all
"1","b24d686c","/bin/sh -c /usr/local/etc/mos/etc/init/S38wakelan start &"

Re: Wake NAS when pressing NAS button

PostPosted: 14 Feb 2016, 15:57
by FarVoice
а ещё проще
Code: Select all
"1","b24d686c","/bin/sh -c /usr/local/etc/mos/bin/pm start wakelan &"


при условии, что moS обновлён ;)

Re: Wake NAS when pressing NAS button

PostPosted: 15 Feb 2016, 22:43
by DerDicke
Thank you so much!

I tried your code, but it didn't work either. So I tried different variants of it.

This code finally worked:
Code: Select all
"1","b24d686c","/usr/local/etc/mos/etc/init/S38wakelan start &",   WOL DS212


большое спасибо!!!