[OpenWrt-Devel] [PATCH 5/5] base-files: add 'wifi reconf'

Daniel Golle daniel at makrotopia.org
Wed Oct 30 11:59:14 EDT 2019


From: John Crispin <john at phrozen.org>

Now that netifd and hostapd allow dynamic reconfiguration, add a
command to trigger it.

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/base-files/files/sbin/wifi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index f7a10de215..261d2fb500 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -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
-- 
2.23.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list