Waking up your NAS - Xiaomi Mini

Here's my set up for waking my NAS when my TV is switched on.
I've got my TV on a fixed IP (via my DHCP server) which is (currently) running on another OpenWRT router in the network.
opkg install etherwake
then this little script (wakenas) to check wether my TV is up/pingable at 10.0.0.60
#!/bin/sh
if ping -q -c 1 -W 10 10.0.0.60 > /dev/null 2>/dev/null; then
   etherwake -b -i br-lan 18:a9:05:da:51:fc
   logger -t cron_wakenas "TV 10.0.0.60 up - sending WoL"
fi

and finally let it run every minute via cron (via luci->system->scheduled tasks) or add the line to  /etc/crontabs/root
* * * * * /bin/wakenas
restart cron with /
etc/init.d/cron restart
done!
Next Post Previous Post
No Comment
Add Comment
comment url