From patchwork Sun Jan 21 14:47:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3,2/2] fff-web: Disable WiFi devices via Web UI From: Adrian Schmutzler X-Patchwork-Id: 755 Message-Id: <1516546069-2586-2-git-send-email-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Sun, 21 Jan 2018 15:47:49 +0100 This uses the new fff-config option to provide users the possibility of enabling/disabling WiFi devices via the Web UI. Signed-off-by: Adrian Schmutzler --- Changes in v2: - Added uci -q set fff.wifi=fff Changes in v3: - Use functions introduced in patch 1/2. --- .../fff-web/files/www/ssl/cgi-bin/settings.html | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html index 26acb8a..6147ae9 100755 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings.html @@ -1,7 +1,11 @@ #!/usr/bin/haserl <% +. /lib/functions/fff/wireless + # write +radio2="$(wifiGetPhy "2")" +radio5="$(wifiGetPhy "5")" if [ "$REQUEST_METHOD" == "POST" ] ; then #check for valid hostname as specified in rfc 1123 #see http://stackoverflow.com/a/3824105 @@ -58,8 +62,21 @@ if [ "$REQUEST_METHOD" == "POST" ] ; then uci -q set "system.poe_passthrough.value=0" fi fi + + if [ "$POST_enable24ghz" == "on" ] ; then + wifiSetActive "2" "1" + else + wifiSetActive "2" "0" + fi + if [ "$POST_enable5ghz" == "on" ] ; then + wifiSetActive "5" "1" + else + wifiSetActive "5" "0" + fi uci -q commit + + wifi > /dev/null MSG='Daten gespeichert! - Bitte Router neustarten.' fi @@ -80,6 +97,16 @@ if [ "$(uci -q get 'fff.notifyupdate.value')" == "0" ] ; then # not set=1 else upgrade_checked="$chkd" fi +if [ "$(uci -q get 'fff.wifi.disable24ghz')" = "1" ] ; then # not set=0 + enable24ghz_checked="" +else + enable24ghz_checked="$chkd" +fi +if [ "$(uci -q get 'fff.wifi.disable5ghz')" = "1" ] ; then # not set=0 + enable5ghz_checked="" +else + enable5ghz_checked="$chkd" +fi %> <% show_msg %>
@@ -132,6 +159,16 @@ fi /> <% fi %> + <% if [ -n "$radio2" ] ; then %> + Enable 2.4 GHz WiFi device: + /> + + <% fi %> + <% if [ -n "$radio5" ] ; then %> + Enable 5 GHz WiFi device: + /> + + <% fi %>