base-files: add 'wifi reconf'
authorJohn Crispin <john@phrozen.org>
Wed, 30 Oct 2019 15:59:14 +0000 (16:59 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 12 Nov 2019 10:52:38 +0000 (11:52 +0100)
Now that netifd and hostapd allow dynamic reconfiguration, add a
command to trigger it.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/base-files/Makefile
package/base-files/files/sbin/wifi

index addbac8664470c43ac608c33e4a2c4ad7f3e3071..5c121ace24da95d496457886bfd79d1265c04e8c 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=206
+PKG_RELEASE:=207
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index f7a10de215c92e4bc6ec446d955fba874ce56d97..261d2fb500b9f41e7f0346f7c84bb7f5a003caa0 100755 (executable)
@@ -130,6 +130,10 @@ wifi_updown() {
                scan_wifi
                cmd=up
        }
+       [ reconf = "$1" ] && {
+               scan_wifi
+               cmd=reconf
+       }
        ubus_wifi_cmd "$cmd" "$2"
        _wifi_updown "$@"
 }
@@ -241,6 +245,7 @@ case "$1" in
        reload) wifi_reload "$2";;
        reload_legacy) wifi_reload_legacy "$2";;
        --help|help) usage;;
+       reconf) ubus call network reload; wifi_updown "reconf" "$2";;
        ''|up) ubus call network reload; wifi_updown "enable" "$2";;
        *) usage; exit 1;;
 esac