[OpenWrt-Devel,2/2] base-files: use initial_setup indicator to improve SSID setup
diff mbox series

Message ID 20191108120520.1966-2-freifunk@adrianschmutzler.de
State Rejected
Delegated to: Adrian Schmutzler
Headers show
Series
  • [OpenWrt-Devel,1/2] base-files: indicate initial setup by uci system config option
Related show

Commit Message

Adrian Schmutzler Nov. 8, 2019, 12:05 p.m. UTC
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@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(-)

Patch
diff mbox series

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.@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)