Skip to content

Commit 1754233

Browse files
authored
[RTC] Update HW clock before start of chrony (#24584)
[RTC] Update HW clock before start of chrony
1 parent 84ea073 commit 1754233

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
hwclock --show &> /dev/null
4+
if [ $? -ne 0 ]; then
5+
echo "hwclock --show failed, attempting hwclock --systohc..."
6+
hwclock --systohc
7+
fi
8+
39
sonic-cfggen -d -t /usr/share/sonic/templates/chrony.conf.j2 >/etc/chrony/chrony.conf
410
sonic-cfggen -d -t /usr/share/sonic/templates/chrony.keys.j2 >/etc/chrony/chrony.keys
511
chmod o-r /etc/chrony/chrony.keys

0 commit comments

Comments
 (0)