1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2024-12-20 12:53:35 +01:00
OpenVoiceOS/buildroot-external/rootfs-overlay/etc/NetworkManager/dispatcher.d/10-update-timesyncd
2020-07-21 08:18:22 +02:00

21 lines
493 B
Bash
Executable File

#! /usr/bin/bash
[ -n "$CONNECTION_UUID" ] || exit
INTERFACE=$1
ACTION=$2
case $ACTION in
up | dhcp4-change | dhcp6-change)
[ -n "$DHCP4_NTP_SERVERS" ] || exit
exec > /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
echo "[Time]"
echo "NTP=$DHCP4_NTP_SERVERS"
systemctl restart systemd-timesyncd
;;
down)
rm -f /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
systemctl restart systemd-timesyncd
;;
esac