fff-hoods: Replace wifi command with reload_config

Submitted by Adrian Schmutzler on July 22, 2019, 8:42 p.m.

Details

Message ID 20190722204252.2461-1-freifunk@adrianschmutzler.de
State New
Headers show

Commit Message

Adrian Schmutzler July 22, 2019, 8:42 p.m.
If wireless config has changed, reload_config will automatically
adjust wireless interfaces.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

Resend of single patch starting at v1 again.
---
 src/packages/fff/fff-hoods/Makefile                      | 2 +-
 .../fff/fff-hoods/files/usr/lib/functions/fff/hoodfile   | 1 -
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood  | 9 ++++-----
 3 files changed, 5 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile
index 11d2523b..5eb20ca5 100644
--- a/src/packages/fff/fff-hoods/Makefile
+++ b/src/packages/fff/fff-hoods/Makefile
@@ -1,7 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-hoods
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
index 9bc6a35d..8ea30d55 100644
--- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
+++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
@@ -27,7 +27,6 @@  getWirelessHoodfile() {
 	uci commit wireless
 	reload_config
 
-	wifi
 	# wait a moment to start the interface
 	sleep 10;
 
diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index d5dc2c00..81bc37ff 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -60,8 +60,8 @@  if [ -s "$hoodfilewww" ] && isGatewayAvailable ; then
 		needwifi="1"
 	done
 
-	if [ "$needwifi" = "1" ] ; then
-		wifi
+	if [ "$needwifi" = "1" ]; then
+		reload_config
 		sleep 10
 	fi
 fi
@@ -145,7 +145,6 @@  if [ -s "$hoodfiletmp" ]; then
 		uci set "system.@system[0].hood=$hood"
 		uci set "system.@system[0].hoodid=$hoodid"
 		uci commit system
-		reload_config
 
 		for radio in $(wifiListRadio); do
 			freq="$(wifiGetFreq $radio)"
@@ -191,8 +190,8 @@  if [ -s "$hoodfiletmp" ]; then
 		done
 
 		uci commit wireless
-		echo "Loading wifi"
-		wifi
+		echo "Reloading wifi"
+		reload_config
 
 		oldntp="$(uci -q get system.ntp.server)"
 		newntp="${ntpip}" # requires routable address, no link-local