From patchwork Mon Jul 22 20:42:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: fff-hoods: Replace wifi command with reload_config From: Adrian Schmutzler X-Patchwork-Id: 1159 Message-Id: <20190722204252.2461-1-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Mon, 22 Jul 2019 22:42:52 +0200 If wireless config has changed, reload_config will automatically adjust wireless interfaces. Signed-off-by: Adrian Schmutzler Reviewed-by: Fabian Bläse --- 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(-) 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