From d19fd7d2cc6dba356ffd5dbb5c509f362555710d Mon Sep 17 00:00:00 2001 From: Andrew Battat Date: Thu, 16 Jan 2025 15:53:55 +0000 Subject: [PATCH] sync ntp first, then update the hardware clock --- ic-os/components/setupos-scripts/check-ntp.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ic-os/components/setupos-scripts/check-ntp.sh b/ic-os/components/setupos-scripts/check-ntp.sh index 15d0b370217..fa74d8632d7 100644 --- a/ic-os/components/setupos-scripts/check-ntp.sh +++ b/ic-os/components/setupos-scripts/check-ntp.sh @@ -8,11 +8,6 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin" source /opt/ic/bin/functions.sh -function set_hwclock_utc() { - echo "* Setting hardware clock to UTC..." - timedatectl set-local-rtc 0 -} - function check_ntp() { echo "* Checking Chrony status..." @@ -36,10 +31,15 @@ function check_ntp() { echo "* Chrony is running and time is in sync." } +function set_hwclock_utc() { + echo "* Setting hardware clock to UTC..." + timedatectl set-local-rtc 0 +} + main() { log_start "$(basename $0)" - set_hwclock_utc check_ntp + set_hwclock_utc log_end "$(basename $0)" }