≡ Menu

Simple Shell Script To Wake Up NAS Devices Using Linux or Unix Computer

A simple bash shell script to wake up nas devices / home servers using mac address.

How do I use this script?

First, install Wake-on-LAN (WOL) client under Unix or Linux operating systems.

Next, download this script and put in your home directory as master.wol.sh
wget -O 558.sh.zip 'http://bash.cyberciti.biz/dl/558.sh.zip?id=82aa046ab4872920e2fb0c9add0bd169'
unzip 558.sh.zip
mv 558.sh ~/bin/master.wol.sh
chmod +x ~/bin/master.wol.sh

Edit the script and set nas server mac address. Finally, create a symbolic link using ln command:
ln -s master.wol.sh wakeup.nas01
ln -s master.wol.sh wakeup.nas02
ln -s master.wol.sh wakeup.nas03

To wake up nas01 using WOL, enter:

{ 2 comments… add one }
  • Bill May 5, 2016, 5:31 pm

    The Buffalo nas will start in this way above! Thats good.

    But then after 3 min it will go down again because of Buffalo NAS systems have an “Auto Power” mode: the NAS stays up&running while the (windows) pc is running. It’s done with a (windows) service, always running, that send 3 (why 3?) wake-on-lan packets to the NAS every (about) 30 seconds. When you shutdown the pc, the NAS stops receiving w-o-l packets, wait about 3 minutes, then shutdown itself.

    I found a solution for that here:


  • Robert March 12, 2014, 7:31 am


    It would be nicer to do an indirect call to the variable that is the name with which you call the program to avoid the case clause, but I don’t know how that is done in bash. I mean to recall the value of the variable whose name is the value of a variable.

Security: Are you a robot or human?

Leave a Comment