aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 9fad1896ec..f5e8ebefbd 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -619,6 +619,26 @@ ucidef_add_gpio_switch() {
json_select ..
}
+ucidef_set_hostname() {
+ local hostname="$1"
+
+ json_select_object system
+ json_add_string hostname "$hostname"
+ json_select ..
+}
+
+ucidef_set_ntpserver() {
+ local server
+
+ json_select_object system
+ json_select_array ntpserver
+ for server in "$@"; do
+ json_add_string "" "$server"
+ done
+ json_select ..
+ json_select ..
+}
+
board_config_update() {
json_init
[ -f ${CFG} ] && json_load "$(cat ${CFG})"