Skip to content

Commit

Permalink
armbian-next: SYNC_CLOCK: don't attempt if ntpd is running; don't…
Browse files Browse the repository at this point in the history
… fail if `ntpdate` fails for any reason
  • Loading branch information
rpardini committed Jan 9, 2023
1 parent 1e53ac2 commit d42d340
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/functions/host/prepare-host.sh
Expand Up @@ -100,9 +100,14 @@ prepare_host() {
acng_configure_and_restart_acng

# sync clock
if [[ $SYNC_CLOCK != no && -f /var/run/ntpd.pid ]]; then
display_alert "ntpd is running, skipping" "SYNC_CLOCK=no" "debug"
SYNC_CLOCK=no
fi

if [[ $SYNC_CLOCK != no ]]; then
display_alert "Syncing clock" "host" "info"
run_host_command_logged ntpdate "${NTP_SERVER:-pool.ntp.org}"
run_host_command_logged ntpdate "${NTP_SERVER:-pool.ntp.org}" || true # allow failures
fi
fi

Expand Down

0 comments on commit d42d340

Please sign in to comment.