Recently, I found the need to toggle the status of my virtual wireless network. For example, turning on the guest wireless network when visitors are around and turning it off when they leave the place. The regular method is to go to the web admin page and disable the entire interface but this is a little clumsy. I don’t really like to leave my guest alone while I tap away on the computer.
And so I scripted something and made use of the SES/WPS/AOSS button to toggle the intended wireless interface.
The script below runs perfectly on my ASUS RT-AC66U with Tomato (Shibby). It should work with any routers that supports TomatoUSB firmware. Just put it under Administration -> Buttons/LED.
# Change it to the intended wireless interface
# You don't really need to change anything below
[ $(nvram get $cwl"_radio") -eq 1 ] && nvram set $cwl"_radio"=0 || nvram set $cwl"_radio"=1
nvram set $cwl"_bss_enabled"=$(nvram get $cwl"_radio")
logger CUSTOM : $cwl set to $(nvram get $cwl"_radio"), restarting wireless ...
service wireless restart