FEATURE REQ: WiFi on/off with side switch?

Both the openvpn & wireguard toggle scripts used it, so seemed like the done thing. :wink:

Each radio state change gets posted to the log anyway, so no benefit of another line?

Oh, well. I was thinking it might be related to firewall states needing a few ticks to properly reload or the like.

Re: logs: I like to ensure my scripts log their actions for potential/future cases of troubleshooting. A separate item makes logwalking w/ logread -e a touch easier. YMMV.

Thanks so much for this guide. It works perfect on my Gl MT300 V2 :star_struck:

2 Likes

Related:

Ok but with this script I face a problem, I need now guest2G only and ok the script works perfectly .... except that internet doesn't work on it.

I was having a hard time getting this to work, so I tweaked the original file rather than replacing it, and select the Tor mode in the GUI. Here's what I did.

cp switchaction switchaction.bak #Backup original file just in case
vim switchaction

then replace the Tor entries by

wifi <up/down>
wifi reload
/etc/init.d/led <start/stop>

as illustrated below
{9C4B430F-8091-4927-AF96-5DFFDC33C808}

When WiFi is on, the LED is on.
When I turn it off using the switch, I easily know it since the LED is off too, and I don't get radiated (AP is on my desk and next to my face).
This script will work with all models, but obviously if you don't have a LED on your model, you can removes those lines.

1 Like