diff mbox series

[03/11] base-files: uci-defaults: allow setting default timezone

Message ID 20240923171825.148902-4-john@phrozen.org
State Under Review
Delegated to: John Crispin
Headers show
Series allow loading default credentials from flash | expand

Commit Message

John Crispin Sept. 23, 2024, 5:18 p.m. UTC
Introduce new uci-default functions:
	- ucidef_set_timezone TZ

Signed-off-by: John Crispin <john@phrozen.org>
---
 package/base-files/files/lib/functions/uci-defaults.sh | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index bcc78220cc..67862497c0 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -642,6 +642,13 @@  ucidef_set_hostname() {
 	json_select ..
 }
 
+ucidef_set_timezone() {
+	local timezone="$1"
+	json_select_object system
+		json_add_string timezone "$timezone"
+	json_select ..
+}
+
 ucidef_set_wireless() {
 	local band="$1"
 	local ssid="$2"