From 2d646e983864558cbf50a0e2150b080a70976d8b Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Fri, 4 Nov 2016 19:31:07 +0100 Subject: [PATCH] ntp: init with hardcoded ip if dns not work 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 --- config/rootfiles/core/107/filelists/files | 1 + src/initscripts/init.d/ntp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/config/rootfiles/core/107/filelists/files b/config/rootfiles/core/107/filelists/files index 226f45b6df..94704cf6c4 100644 --- a/config/rootfiles/core/107/filelists/files +++ b/config/rootfiles/core/107/filelists/files @@ -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 diff --git a/src/initscripts/init.d/ntp b/src/initscripts/init.d/ntp index d411ba18d6..0793927908 100644 --- a/src/initscripts/init.d/ntp +++ b/src/initscripts/init.d/ntp @@ -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!" -- 2.39.5