From a93d48e849470cd16c721a601e1117c6d8144022 Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Fri, 18 Apr 2014 08:30:50 -0700 Subject: [PATCH] Fix wifi being disabled after applying setting on non-chain devices fixes BBHN->ticket:39 --- files/www/cgi-bin/setup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index dc4436eb..17c1ab94 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -134,15 +134,16 @@ $parms{wifi_rxant} = $wifi_rxant; if($parms{button_apply} or $parms{button_save}) { - $cmd = "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;"; + $cmd = ""; if(wifi_useschains()){ $cmd .= "echo $wifi_rxant > /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask;"; $cmd .= "echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask;"; } else { - $cmd .= "ifconfig wlan0 down >/dev/null 2>&1;"; + $cmd .= "ifdown wifi >/dev/null 2>&1;"; $cmd .= "iw phy phy0 set antenna $wifi_txantenna $wifi_rxantenna >/dev/null 2>&1;"; - $cmd .= "ifconfig wlan0 up >/dev/null 2>&1;"; + $cmd .= "ifup wifi >/dev/null 2>&1;"; } + $cmd .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;"; $cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;"; system $cmd; }