Configuring the "switch button" to disable wifi radio

How do I go about configuring the switch on the GL-MT300N-V1 to disable the wifi radio under /rc.button/ ?

What are the exact commands?

This would be a great feature by default.

Is this really necessary? I am afraid some people accidentally turned off the wifi and will blame the router defective.

I have some hints in another post.

I had plugged the wan into the lan and the lan into the wan and spent 20 minutes trying to figure it out. Is it necessary to create a lesser product for everyone, just for some stupid minds? It would be a great feature. I disable all my wifi devices before I sleep so I don’t fry my brains anymore than they already are; Thank you so much.

Here is what the staff had told me in email:

The correct script for the switch button is /etc/init.d/initswitch

You can have a try to edit the script. Add the red text

Turn on wifi when switch on left side

Line 57:

"noop")
;;
*)
uci set wirless.@wifi-iface[0].disabled=0
uci commit wireless
wifi on
;;

Turn off wifi when switch on left side
Line 70 (before editing):
“noop”)
;;
*)
uci set wirless.@wifi-iface[0].disabled=1
uci commit wireless
wifi off
;;

I’ve been thinking about configuring the switch to turn on and off a wireguard connection. I would love to learn how to do it.

Can you explain how to edit this file. I can’t seem to access root

use winscp to edit files Modify files on the router - GL.iNet Docs

Thank you, I have already edited the files appropriately and got it working. I just don’t think that should be the only option.

Seeing how many times it has been requested i thought they would do something by now