#!/bin/sh # 70-clock.sh — Set system clock (best-effort NTP or hwclock) # Try hardware clock first if command -v hwclock >/dev/null 2>&1; then hwclock -s 2>/dev/null && log "Clock set from hardware clock" && return 0 fi # Try NTP (one-shot, non-blocking) if command -v ntpd >/dev/null 2>&1; then ntpd -n -q -p pool.ntp.org >/dev/null 2>&1 & log "NTP sync started in background" elif command -v ntpdate >/dev/null 2>&1; then ntpdate -u pool.ntp.org >/dev/null 2>&1 & log "NTP sync started in background" else log_warn "No NTP client available — clock may be inaccurate" log_warn "K8s certificate validation may fail if clock is far off" fi