]> git.ipfire.org Git - people/dweismueller/ipfire-2.x.git/commitdiff
ntp: init with hardcoded ip if dns not work
authorArne Fitzenreiter <arne_f@ipfire.org>
Fri, 4 Nov 2016 18:31:07 +0000 (19:31 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 4 Nov 2016 18:31:07 +0000 (19:31 +0100)
DNSSec need the correct time to validate the zones so we need
a workaround to init the time without dns.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/rootfiles/core/107/filelists/files
src/initscripts/init.d/ntp

index 226f45b6df8ad755b8a85081dc45e1d311925f1e..94704cf6c458caf32de7b164e917c9eee8519b8d 100644 (file)
@@ -2,6 +2,7 @@ etc/system-release
 etc/issue
 etc/unbound/unbound.conf
 etc/rc.d/init.d/unbound
+etc/rc.d/init.d/ntp
 srv/web/ipfire/cgi-bin/logs.cgi/log.dat
 srv/web/ipfire/cgi-bin/traffic.cgi
 var/ipfire/langs
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!"