I find that the network availability test in ntpd-runit run script has started to fail (for me at least in armtix).
The test [ "$(ip route | awk '/^default/{print ($3!="")+($5!="")}')" = "2" ]
is failing because the awk command is now producing two lines
# ip route | awk '/^default/{print ($3!="")+($5!="")}'
2
2
which is because the output of the route command may contain two default lines eg
# ip route
default via 192.168.0.1 dev eth0 proto dhcp metric 100
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.41 metric 1002
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.41 metric 100
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.41 metric 1002
I don't know if this is specific to my network. The simple awk test could be resurrected by using an awk line like this
[ "`ip route|awk '/^default/{if(($3!="")+($5!="")==2){print 1;exit 0}}'`" = "1" ]
I continue to use a script, have-net, which now looks like this # cat /bin/have-net
#/bin/sh
for d in /sys/class/net/*;do
[ `basename $d` = lo ] && continue
[ "`cat $d/operstate`" = "up" ] && echo "connected" && exit 0
done
[ -x /usr/bin/ip -a -x /usr/bin/awk ] \
&& [ "`ip route|awk '/^default/{if(($3!="")+($5!="")==2){print 1;exit 0}}'`" = "1" ] \
&& echo "connected" \
&& exit 0
fi
echo "disconnected"
exit 1
and my ntpd run is changed to # cat ntpd/run
#!/bin/sh
/usr/bin/have-net >/dev/null 2>&1 || exit 1
ntpd -g -q #run once and exit
exec ntpd -g -u ntp:ntp -n >/dev/null 2>&1