echo "NTP will default to $NTPD"
fi
+ printf "Checking for timesyncd ... "
+ TIMESYNCD=
+ for x in /usr/lib/systemd/systemd-timesyncd; do
+ if [ -x "$x" ]; then
+ TIMESYNCD=$x
+ break
+ fi
+ done
+ if [ -n "$TIMESYNCD" ]; then
+ echo "$TIMESYNCD"
+ HOOKS="$HOOKS${HOOKS:+ }50-timesyncd.conf"
+ else
+ echo "not found"
+ fi
+
printf "Checking for ypbind ... "
YPBIND=$(_which ypbind)
if [ -n "$YPBIND" ]; then
--- /dev/null
+: ${timesyncd_conf_d:=/run/systemd/timesyncd.conf.d}
+timesyncd_conf="${timesyncd_conf_d}/dhcpcd-$ifname.conf"
+timesyncd_tmp_d="$state_dir/timesyncd"
+timesyncd_tmp="$timesyncd_tmp_d/$ifname"
+
+NL="
+"
+
+add_timesyncd_conf()
+{
+ [ -n "$new_ntp_servers" ] || return
+
+ mkdir -p "$timesyncd_tmp_d" "$timesyncd_conf_d"
+
+ conf="$signature$NL"
+ conf="${conf}[Time]$NL"
+ conf="${conf}NTP=$new_ntp_servers$NL"
+
+ printf %s "$conf" > "$timesyncd_tmp"
+ if change_file "$timesyncd_conf" "$timesyncd_tmp"; then
+ systemctl try-reload-or-restart systemd-timesyncd
+ fi
+}
+
+remove_timesyncd_conf()
+{
+ if [ -e "$timesyncd_conf" ]; then
+ rm "$timesyncd_conf"
+ systemctl try-reload-or-restart systemd-timesyncd
+ fi
+}
+
+if $if_configured; then
+ if $if_up; then
+ add_timesyncd_conf
+ elif $if_down; then
+ remove_timesyncd_conf
+ fi
+fi