mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2024-12-20 12:53:35 +01:00
21 lines
493 B
Bash
Executable File
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
|