1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 11:01:50 +00:00
openmptcprouter-feeds/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi
Ycarus (Yannick Chabanois) 7a549a6628 Set country default for wifi
2021-07-29 09:24:11 +02:00

23 lines
660 B
Bash
Executable file

#!/bin/sh
if [ "$(uci -q get wifi-iface.radio0)" != "" ] && [ "$(uci -q get wifi-iface.default_radio0.key)" = "12345678" ]; then
if [ "$(uci -q get wifi-device.radio0.country)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set wifi-device.radio0.country='FR'
commit wifi-device
EOF
fi
if [ -n "$(uci -q get wifi-iface.radio0.network | grep lan)" ]; then
uci -q batch <<-EOF >/dev/null
set wifi-iface.default_radio0.network='wifi'
commit wifi-iface
EOF
fi
if [ -n "$(uci -q get wifi-device.radio0.cell_density)" ]; then
uci -q batch <<-EOF >/dev/null
delete wifi-device.radio0.cell_density
commit wifi-device
EOF
fi
fi
exit 0