[PATCH] configurehood: Provide options to disable AP and Mesh for WiFi
Adrian Schmutzler
freifunk at adrianschmutzler.de
Do Mär 8 21:43:14 CET 2018
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 <freifunk at adrianschmutzler.de>
---
.../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
--
2.7.4
Mehr Informationen über die Mailingliste franken-dev