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

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 2 06:48:08 PDT 2024


blogic pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/fa53a733abbef5a001a5ff9ba1d7b1822e4caae6

commit fa53a733abbef5a001a5ff9ba1d7b1822e4caae6
Author: John Crispin <john at phrozen.org>
AuthorDate: Sat Sep 21 16:17:17 2024 +0200

    base-files: uci-defaults: allow setting default timezone
    
    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 507ddfc11a..4a710aab2c 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"




More information about the lede-commits mailing list