#!/bin/sh set -e # Ensure /etc/ntp.conf exists for tools/hooks expecting it if [ -f /etc/ntpd.conf ] && [ ! -e /etc/ntp.conf ]; then ln -sf /etc/ntpd.conf /etc/ntp.conf fi # dhcpcd hook may write into /var/lib/ntp mkdir -p /var/lib/ntp # Extract ntp=... from kernel cmdline if present ntp_flags="" params="" if [ -n "" ]; then # Convert comma-separated list into multiple -p args params="-p " else # Sensible defaults when no ntp= is provided params="-p time.google.com -p time1.google.com -p time2.google.com -p time3.google.com" fi # BusyBox ntpd uses -p servers on CLI; /etc/ntp.conf symlink above helps alternative daemons. exec ntpd -n