chrony: improve hotplug script

- Use the chronyc onoffline command to update state of all sources
  per current routing configuration
- Don't ignore the "ifupdate" action
- Add NTP servers from DHCP for the interface that went up instead of
  the wan4+wan6 interfaces
- Save the servers to files loaded by the sourcedir directive to not
  lose them when chronyd is restarted, and remove them when the
  interface goes down

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
This commit is contained in:
Miroslav Lichvar
2020-10-30 20:02:48 +01:00
parent 1dc8c501a6
commit b9d6d6cdd0
2 changed files with 21 additions and 17 deletions
+3
View File
@@ -1,6 +1,9 @@
# Load UCI configuration
confdir /var/etc/chrony.d
# Load NTP servers from DHCP if enabled in UCI
sourcedir /var/run/chrony-dhcp
# Log clock errors above 0.5 seconds
logchange 0.5