ntpd: wait for /etc/resolv.conf

This commit is contained in:
Jaroslav Kysela 2018-09-21 09:53:27 +02:00
parent fa597cbb12
commit 100ef6e46f
1 changed files with 5 additions and 0 deletions

View File

@ -4,5 +4,10 @@ while test ! -f /tmp/nontpd; do
NTPD_OPTS=""
test -r /etc/sysconfig/config && . /etc/sysconfig/config
test -z "$NTPD_OPTS" && NTPD_OPTS="-p 0.pool.ntp.org"
i=0
while test ! -f /etc/resolv.conf -a $i -le 100; do
sleep 0.2
i=$(expr $i + 1)
done
/usr/sbin/ntpd -n -I eth0 $NTPD_OPTS
done