Skip to content

Instantly share code, notes, and snippets.

@bkram
Created January 22, 2022 16:27
Show Gist options
  • Save bkram/26045e53936a71f326b94cad9fbcfffa to your computer and use it in GitHub Desktop.
Save bkram/26045e53936a71f326b94cad9fbcfffa to your computer and use it in GitHub Desktop.
openwrt disable or enable a ssid
#!/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