base-files: uci-defaults: allow setting default timezone
authorJohn Crispin <john@phrozen.org>
Sat, 21 Sep 2024 14:17:17 +0000 (16:17 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 2 Oct 2024 13:41:33 +0000 (15:41 +0200)
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

index 507ddfc11ae1cea84dc69cbc8b5d244304a58e4b..4a710aab2c9356919b9dc61645ee210b3792ad8a 100644 (file)
@@ -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"