Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Fri Nov 24, 2017 5:35 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Feb 25, 2015 10:39 pm 
Offline
Newbie

Joined: Wed Feb 25, 2015 10:33 pm
Posts: 5
any idea about switching the unit on and off (when in AUTO mode) using Linux? I would avoid to use a virtual machine with windows only for this purpose!!

thanks
rosanna


Last edited by scimmiettarossa on Thu Feb 26, 2015 10:00 pm, edited 1 time in total.

Top
   
PostPosted: Thu Feb 26, 2015 7:10 am 
Offline
Moderator

Joined: Mon Apr 26, 2010 10:24 am
Posts: 2691
Code:
#!/bin/sh
MY_HOSTS="192.168.123.151 192.168.123.152 192.168.123.167"
MY_BROADCAST="192.168.123.255"
LINKSTATION_MAC="00:24:00:00:00:00"
PERIODE=120

while [ true ]
do
        WOL_SENDEN="false"
        for i in $MY_HOSTS
        do
                if ping -c 1 -w 1 $i > /dev/null; then
                        WOL_SENDEN=true
                fi
        done
        if $WOL_SENDEN; then
                /usr/sbin/wol -i $MY_BROADCAST -p 9 $LINKSTATION_MAC > /dev/null
        fi
        sleep $PERIODE
done



from
http://forum.nas-hilfe.de/buffalo-technology-nas-anleitungen/automatisches-ein-und-ausschalten-in-einem-linuxnetzwerk-t848.html


Top
   
PostPosted: Thu Feb 26, 2015 4:58 pm 
Offline
Newbie

Joined: Wed Feb 25, 2015 10:33 pm
Posts: 5
tnx for your answer....
looking at the code (and trying to understand deutsh from the original source) I believe that this script should run a "third machine" (router?) that is always on... the point is that I do not think I can add this script on the router...

what happens if I run the "wake on" part on my linux machine (putting the modified script under a cron activity, or leaving the script iterate infinitely) andat a certain point I switch the linux machine off?


Top
   
PostPosted: Thu Feb 26, 2015 5:08 pm 
Offline
Moderator

Joined: Mon Apr 26, 2010 10:24 am
Posts: 2691
Code:
#!/bin/sh
MY_BROADCAST="192.168.???.255"
LINKSTATION_MAC="00:24:00:00:00:00"
PERIODE=120

while [ true ]
do
/usr/sbin/wol -i $MY_BROADCAST -p 9 $LINKSTATION_MAC > /dev/null
sleep $PERIODE
done


Modify ??? and MAC and run this on linux


Top
   
PostPosted: Thu Feb 26, 2015 5:13 pm 
Offline
Newbie

Joined: Wed Feb 25, 2015 10:33 pm
Posts: 5
tnx again!


Top
   
PostPosted: Thu Feb 26, 2015 10:00 pm 
Offline
Newbie

Joined: Wed Feb 25, 2015 10:33 pm
Posts: 5
it works, but with "-p 2304"

tnx again!

rosanna


Top
   
PostPosted: Thu Feb 26, 2015 10:51 pm 
Offline
Moderator

Joined: Mon Apr 26, 2010 10:24 am
Posts: 2691
1) from where you have port 2304?
2) you use a LS-WXL?


Top
   
PostPosted: Sat Feb 28, 2015 10:11 pm 
Offline
Newbie

Joined: Wed Feb 25, 2015 10:33 pm
Posts: 5
1) forum on buffalotech
2) yes


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited