My system is configured to use dnsmasq to provide local network name resolution; the OpenWRT router is pointed at it too, but DNSmasq comes up too late in the boot process for NTP client. This change just checks that both a default route is available and the name is resolvable, and keeps sleeping until that is the case.

I suppose it might want minor alteration to check for IP returns from the nvram to short circuit the test.

#!/bin/sh
server=$(nvram get ntp_server)
case "$ACTION" in
        ifup)
                ps x | grep '[n]tpclient' >&- || {
                        nslookup $server >/dev/null 2>&1 && route -n 2>&- | grep '^0.0.0.0'

                        while [ $? -gt 0 ] ; do
                                sleep 10
                                nslookup $server >/dev/null 2>&1 && route -n 2>&- | grep '^0.0.0.0'
                        done
                        /usr/sbin/ntpclient -c 1 -s -h ${server:-pool.ntp.org} &
                }
                ;;
        ifdown)
                route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
esac

Question is simpler - any reason not to include diff in the busybox build? Everyone seems to fling huge sets fo nvram show | sort about to diagnose problems and it'd be handy for comparing configs to see what you have thats not the same wink

Just wondering; hope the scripts helpful

Matt