Skip to content

Commit

Permalink
sync ntp first, then update the hardware clock
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbattat committed Jan 16, 2025
1 parent 25a080f commit d19fd7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ic-os/components/setupos-scripts/check-ntp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand All @@ -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)"
}

Expand Down

0 comments on commit d19fd7d

Please sign in to comment.