Re: [SOLVED] how to wait on network
Reply #9 –
Thanks Konimex I saw the change in the ntp-runit run script, but after finding it was taking a long time to work I had to add back the initial ntpd -g -q #run once and quit
I'm not sure why the -g option in the exec line doesn't do the same thing, but I think if there's no real time clock on the board (eg for the rpi4 which I am messing with) then the exec line takes a very long time to slew the system time from Jan 1 1970 up to the modern era. I think this might work
#!/bin/sh
[ "$(ip route | awk '/^default/{print ($3!="")+($5!="")}')" = "2" ] || exit 1
[ ! -c /dev/rtc ] && ntpd -g -q #run one large slew and quit if there's no hardware clock
exec ntpd -g -u ntp:ntp -n >/dev/null 2>&1