]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/ntp
ntp: init with hardcoded ip if dns not work
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / ntp
index d411ba18d6f66108df695e1a0c2f192db7255c09..0793927908f762bac2ace9a652793d7831b86c7e 100644 (file)
@@ -27,6 +27,14 @@ case "$1" in
                        fi
                        if [ -e /var/ipfire/red/active ]; then
                                boot_mesg ""
+
+                               host ping.ipfire.org > /dev/null 2>&1
+                               if [ "${?}" != "0" ]; then
+                                       boot_mesg "DNS not work ... init with ntp.ipfire.org at 81.3.27.46 ..."
+                                       loadproc /usr/local/bin/settime 81.3.27.46
+                                       boot_mesg "Setting time on boot..."
+                               fi
+
                                loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
                        else
                                boot_mesg " ERROR! Not online!"