From 97bb92b35bdcf90bf1ddf9ad814a3df39f29c0a3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 7 Sep 2016 16:44:03 +0200 Subject: initial commit --- 30-timesyncd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 30-timesyncd (limited to '30-timesyncd') diff --git a/30-timesyncd b/30-timesyncd new file mode 100755 index 0000000..da0f193 --- /dev/null +++ b/30-timesyncd @@ -0,0 +1,18 @@ +#!/bin/sh + +INTERFACE="${1}" +STATUS="${2}" + +case "${STATUS}" in + up|dhcp4-change) + if [ -n "${DHCP4_NTP_SERVERS}" ]; then + mkdir -p /run/systemd/timesyncd.conf.d/ + echo "[Time]" > /run/systemd/timesyncd.conf.d/${INTERFACE}.conf + echo "NTP = ${DHCP4_NTP_SERVERS}" >> /run/systemd/timesyncd.conf.d/${INTERFACE}.conf + fi + ;; + down) + rm -f /run/systemd/timesyncd.conf.d/${INTERFACE}.conf + ;; +esac + -- cgit v1.2.3-70-g09d2