Wake NAS when pressing NAS button

Wake NAS when pressing NAS button

Postby DerDicke » 14 Feb 2016, 12:35

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.
DerDicke
 
Posts: 2
Joined: 14 Feb 2016, 12:24

Re: Wake NAS when pressing NAS button

Postby Virtual » 14 Feb 2016, 14:01

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 &"
марсы: HDS7 (смотрелка AMP скин vrt )
HDR12 AMP (обычно сервер с RAM 256 и 2 SATA диска 2T+)//но очень иногда оцифровка видео
XTR PRO(AMP, HTTP(S) NFS SMB FTP сервер +trans2.90 + 2 SATA диска 2T+
сатурны: XTR Prodigy, R6S(512Mb_NAND), HD900A(_MD*) прошивка
User avatar
Virtual
 
Posts: 6862
Joined: 01 Oct 2010, 17:17
Location: RU

Re: Wake NAS when pressing NAS button

Postby FarVoice » 14 Feb 2016, 15:57

а ещё проще
Code: Select all
"1","b24d686c","/bin/sh -c /usr/local/etc/mos/bin/pm start wakelan &"


при условии, что moS обновлён ;)
ASUS O!Play R1 (amp_r12_vrtn), xTreamer Pro (amp_r12_vrt), xTreamer Prodigy (iNeXT 2.14 r2), IconBIT HDR12L (amp_r12_vrt), 3Q F425HW (xds42gl_7725_r3), MyGica A11 (mygica_m3_20121222)
User avatar
FarVoice
Администратор
 
Posts: 8572
Joined: 03 Sep 2010, 01:27
Location: Russia, Moscow

Re: Wake NAS when pressing NAS button

Postby DerDicke » 15 Feb 2016, 22:43

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


большое спасибо!!!
DerDicke
 
Posts: 2
Joined: 14 Feb 2016, 12:24


Return to About Asus O!Play

Who is online

Users browsing this forum: No registered users and 17 guests