Created
January 22, 2022 16:27
-
-
Save bkram/26045e53936a71f326b94cad9fbcfffa to your computer and use it in GitHub Desktop.
openwrt disable or enable a ssid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DISABLE_SSID="Kids" | |
off() { | |
for ssid in $(uci show wireless | grep "$DISABLE_SSID" | cut -f 1-2 -d.); do | |
echo Disabling "$ssid" | |
uci -q set "$ssid".disabled=1 | |
uci commit | |
wifi reload | |
done | |
} | |
on() { | |
for ssid in $(uci show wireless | grep "$DISABLE_SSID" | cut -f 1-2 -d.); do | |
echo Enabling "$ssid" | |
uci -q set "$ssid".disabled=0 | |
uci commit | |
wifi reload | |
done | |
} | |
case $1 in | |
on) | |
on | |
;; | |
off) | |
off | |
;; | |
*) | |
echo valid parameters on or off | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment