summaryrefslogtreecommitdiffstats
path: root/debian/chrony.dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'debian/chrony.dhcp')
-rw-r--r--debian/chrony.dhcp25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/chrony.dhcp b/debian/chrony.dhcp
new file mode 100644
index 0000000..690f3ab
--- /dev/null
+++ b/debian/chrony.dhcp
@@ -0,0 +1,25 @@
+SERVERFILE=/var/lib/dhcp/chrony.servers.$interface
+
+chrony_config() {
+ rm -f $SERVERFILE
+ for server in $new_ntp_servers; do
+ echo "$server iburst" >> $SERVERFILE
+ done
+ /usr/lib/chrony/chrony-helper update-daemon || :
+}
+
+chrony_restore() {
+ if [ -f $SERVERFILE ]; then
+ rm -f $SERVERFILE
+ /usr/lib/chrony/chrony-helper update-daemon || :
+ fi
+}
+
+case $reason in
+ BOUND|RENEW|REBIND|REBOOT)
+ chrony_config
+ ;;
+ EXPIRE|FAIL|RELEASE|STOP)
+ chrony_restore
+ ;;
+esac