WiFi toggle on Asus WL-550gE

I don't feel confortable sleeping with my wifi on, so here is a script to turn it off at night:

First I created 2 scripts, one to turn it off:

# vi /root/wifi-off

uci set wireless.@wifi-device[0].disabled=1
echo wifi disabled

And one to turn it back on:

# vi /root/wifi-on

uci set wireless.@wifi-device[0].disabled=0
echo wifi enabled

Then I started up wifi at boot

# vi /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.


exit 0


# crontab -e

 0  7 * * * /root/wifi-on
59 23 * * * /root/wifi-off

The cron service is not enabled by default in OpenWRT:

# /etc/init.d/cron enable
# /etc/init.d/cron start

Good night...

No comments:

Post a Comment