[OpenWrt-Devel] [PATCH 2/2] base-files: use initial_setup indicator to improve SSID setup

Adrian Schmutzler freifunk at adrianschmutzler.de
Fri Nov 8 07:05:20 EST 2019


By exploiting the new initial_setup option, default SSID setup
can be improved so it does not have to rely on the previous SSID
value anymore.

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

---

This patch is a proof-of-concept based on the SSID EUI patch as
just submitted. It's mainly intended to show the use of the
initial_setup option.
---
 .../files/etc/uci-defaults/15_wifi-ssid-mac-address          | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/uci-defaults/15_wifi-ssid-mac-address b/package/base-files/files/etc/uci-defaults/15_wifi-ssid-mac-address
index aeb46e39c0..2ec66b52dd 100644
--- a/package/base-files/files/etc/uci-defaults/15_wifi-ssid-mac-address
+++ b/package/base-files/files/etc/uci-defaults/15_wifi-ssid-mac-address
@@ -1,11 +1,12 @@
 . /lib/functions.sh
 . /lib/functions/system.sh
 
+[ "$(uci get "system. at system[0].initial_setup")" = "1" ] || exit 0
+
 set_wifi_ssid() {
 	local iface="$1"
 
-	[ "$(uci get "wireless.${iface}.ssid")" = "OpenWrt" ] && \
-		uci set "wireless.${iface}.ssid=$ssid"
+	uci set "wireless.${iface}.ssid=$ssid"
 }
 
 label_macaddr=$(get_mac_label)
-- 
2.20.1


_______________________________________________
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