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

John Crispin john at phrozen.org
Mon Sep 23 10:18:17 PDT 2024


Introduce new uci-default functions:
	- ucidef_set_timezone TZ

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

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"
-- 
2.34.1




More information about the openwrt-devel mailing list