summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'builder/modules.d/slx-clock/scripts/configure-timesyncd.sh')
-rw-r--r--builder/modules.d/slx-clock/scripts/configure-timesyncd.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh b/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh
new file mode 100644
index 00000000..af1148eb
--- /dev/null
+++ b/builder/modules.d/slx-clock/scripts/configure-timesyncd.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. /etc/openslx
+
+if [ -n "$SLX_NTP_SERVER" ]; then
+ tsdir="${NEWROOT}/etc/systemd/timesyncd.conf.d"
+ mkdir -p "$tsdir"
+ (
+ echo "[Time]"
+ echo "NTP=$SLX_NTP_SERVER"
+ ) > "${tsdir}/slx-ntp.conf"
+fi