From 986804daa5c3e28721a1d544653518c2ad918b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 6 May 2018 20:32:35 +0200 Subject: [PATCH] aps: Delete radio device 'disabled' key when enabled --- files/common/its/etc/uci-defaults/50-config-from-mac | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/files/common/its/etc/uci-defaults/50-config-from-mac b/files/common/its/etc/uci-defaults/50-config-from-mac index 867bcae..605fcb9 100755 --- a/files/common/its/etc/uci-defaults/50-config-from-mac +++ b/files/common/its/etc/uci-defaults/50-config-from-mac @@ -39,23 +39,27 @@ uci commit dropbear WIFI_DEVICES=$(uci show wireless | sed -nr 's/^wireless\.([^=]+)=wifi-device*$/\1/p') for radio in $WIFI_DEVICES; do - disabled=1 + disabled=true if [ $(uci get wireless.$radio.hwmode) = '11a' ]; then # 5 GHz if [ -n "$channel_11a" ]; then uci set wireless.$radio.channel=$channel_11a uci set wireless.$radio.htmode=${htmode_11a:-HT20} - disabled=0 + disabled=false fi elif [ $(uci get wireless.$radio.hwmode) = '11g' ]; then # 2.4 GHz if [ -n "$channel_11g" ]; then uci set wireless.$radio.channel=$channel_11g - disabled=0 + disabled=false fi fi - uci set wireless.$radio.disabled=$disabled + if $disabled; then + uci set wireless.$radio.disabled=1 + else + uci delete wireless.$radio.disabled || true + fi uci set wireless.$radio.country=AT done uci commit wireless