From patchwork Thu Mar 8 20:43:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: configurehood: Provide options to disable AP and Mesh for WiFi From: Adrian Schmutzler X-Patchwork-Id: 819 Message-Id: <1520541794-4627-1-git-send-email-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Thu, 8 Mar 2018 21:43:14 +0100 By providing uci set fff.wifi.disableap=1 and uci set fff.wifi.disablemesh=1 one can disable wXap and wXmesh, respectively. This affects all interfaces if 2.4 AND 5 GHz are present. To apply the settings after having changed uci, one has to uci commit fff rm /www/hood/keyxchangev2data configurehood Fixes #97. Signed-off-by: Adrian Schmutzler --- .../fff/fff-hoods/files/usr/sbin/configurehood | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 76fdfd8..81228b9 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -264,24 +264,26 @@ if [ -s "$hoodfile" ]; then radio5="$(wifiAddPhyCond "$phy" "5" "$chan5ghz")" [ -n "$radio5" ] && radio="$radio5" - if ! wifiAddAP "$radio" "$essid" "mesh" "ap" "0"; then + if ( ! [ "$(uci -q get 'fff.wifi.disableap')" = "1" ] ) && ! wifiAddAP "$radio" "$essid" "mesh" "ap" "0"; then echo "Can't add AP interface on $radio." exit 1 fi - # add 802.11s mesh if type == "802.11s" - if ( [ -n "$radio5" ] && [ "$mesh_type5" == "802.11s" ] ) || [ "$mesh_type2" == "802.11s" ]; then - if ! wifiAddMesh "$radio" "$mesh_id"; then - echo "Can't add Mesh interface on $radio." - exit 1 + if ( ! [ "$(uci -q get 'fff.wifi.disablemesh')" = "1" ] ) ; then + # add 802.11s mesh if type == "802.11s" + if ( [ -n "$radio5" ] && [ "$mesh_type5" == "802.11s" ] ) || [ "$mesh_type2" == "802.11s" ]; then + if ! wifiAddMesh "$radio" "$mesh_id"; then + echo "Can't add Mesh interface on $radio." + exit 1 + fi fi - fi - # add IBSS mesh if type == "ibss" - if ( [ -n "$radio5" ] && [ "$mesh_type5" == "ibss" ] ) || [ "$mesh_type2" == "ibss" ]; then - if ! wifiAddAdHocMesh "$radio" "$mesh_essid" "$mesh_bssid"; then - echo "Can't add AdHocMesh interface on $radio." - exit 1 + # add IBSS mesh if type == "ibss" + if ( [ -n "$radio5" ] && [ "$mesh_type5" == "ibss" ] ) || [ "$mesh_type2" == "ibss" ]; then + if ! wifiAddAdHocMesh "$radio" "$mesh_essid" "$mesh_bssid"; then + echo "Can't add AdHocMesh interface on $radio." + exit 1 + fi fi fi done