From f7136422ca8b14bde360689046d778ed539a796b Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 12 Jul 2021 18:06:41 +0200 Subject: [PATCH] Fix wifi --- .../files/etc/uci-defaults/2091-omr-wifi | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi b/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi index f2e65c52e..1a6712a95 100755 --- a/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi +++ b/openmptcprouter/files/etc/uci-defaults/2091-omr-wifi @@ -1,18 +1,22 @@ #!/bin/sh -if [ "$(uci -q get wireless.radio0)" != "" ]; then - if [ "$(uci -q get wireless.radio0.country)" = "" ]; then +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 wireless.radio0.country='00' - set wireless.default_radio0.skip_inactivity_poll='1' - commit wireless + set wifi-device.radio0.country='00' + commit wifi-device EOF fi - if [ "$(uci -q get wireless.default_radio0.network)" = "lan" ]; then + if [ -n "$(uci -q get wifi-iface.radio0.network | grep lan)" ]; then uci -q batch <<-EOF >/dev/null - set wireless.default_radio0.network='wifi' - commit wireless + 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