Skip to content

Commit

Permalink
Merge pull request #89 from ElstonLewis/Improvements_Debian12
Browse files Browse the repository at this point in the history
Updated chrony ntp sync script
  • Loading branch information
ElstonLewis authored Oct 24, 2024
2 parents d9b39e5 + 0f743e0 commit 535eafc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions files/chrony-specific/10-dhcp-chrony.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
if [ "$2" = "up" ]; then
if [ -n "$DHCP4_NTP_SERVERS" ]; then
chronyc delete sources
for server in $DHCP4_NTP_SERVERS; do
chronyc add server $server iburst
done
systemctl restart chronyd
fi
fi
4 changes: 3 additions & 1 deletion scripts/linux/ntp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if [[ "$1" == "debian12" ]]; then
chroot /mnt/ apt install chrony -y
fi

# make executable chronyd script fix OMI-239
# chronyd dhcp sync fix OMI-239
if [[ "$1" == "debian12" ]]; then
chmod +x /mnt/etc/dhcp/dhclient-exit-hooks.d/chrony
cp /tmp/chrony-specific/10-dhcp-chrony /mnt/etc/NetworkManager/dispatcher.d/
chmod +x /mnt/etc/NetworkManager/dispatcher.d/10-dhcp-chrony
fi

0 comments on commit 535eafc

Please sign in to comment.