Button Mode, Turn Off Radio

Hello!

Just received a cAP ac and didn’t realize it had a button mode. Is it possible to write a script to turn off the wifi radios? Since our house is mainly hardwired, it would be nice to turn off the Wifi when it’s not required.

EDIT: I’ll add that I’m a software engineer. After looking into this, it does seem possible. My main two questions are…

  1. What does getting/storing a variable look like for the current status (enabled or disabled) to allow toggle.
  2. What do I actually want to turn off? I want no power to the radio, should I turn off the interface or lower tx to 0? Or something else.

Thank you!
Mike

Ended up being very easy.

{
    :local LED;
    :local DISABLED;
	
    :if ([/interface wireless get [find name=wlan1] disabled]) do={ :set DISABLED "no"; set LED "never" } else={ :set DISABLED "yes"; :set LED "immediate" };
    :do { /system leds settings set all-leds-off=$LED }
    :do { /interface wireless set [ find name=wlan1 ] disabled=$DISABLED }
}