From b3aa7a123136f35392cea2d37c91ffce1f416094 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 27 Feb 2014 08:22:11 +0100 Subject: [PATCH 1/1] ntp: wait only if wpa_supplicant is running. --- src/initscripts/init.d/ntp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/initscripts/init.d/ntp b/src/initscripts/init.d/ntp index 885b610b4..548b4c4d0 100644 --- a/src/initscripts/init.d/ntp +++ b/src/initscripts/init.d/ntp @@ -10,23 +10,25 @@ case "$1" in start) if [ "$ENABLESETONBOOT" == "on" ]; then boot_mesg -n "Setting time on boot..." - if [ ! -e /var/ipfire/red/active ]; then - boot_mesg "" - boot_mesg -n "Wait for online connection" - for (( i=30; i>1; i-- )) do - if [ -e /var/ipfire/red/active ]; then - break; - fi - boot_mesg -n "." - sleep 1 - done - sleep 5 + if [ $(pidof wpa_supplicant) ]; then + if [ ! -e /var/ipfire/red/active ]; then + boot_mesg "" + boot_mesg -n "Wait for wlan" + for (( i=30; i>1; i-- )) do + if [ -e /var/ipfire/red/active ]; then + break; + fi + boot_mesg -n "." + sleep 2 + done + sleep 5 + fi fi if [ -e /var/ipfire/red/active ]; then boot_mesg "" loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf) else - boot_mesg " not online!" + boot_mesg " ERROR! Not online!" echo_warning fi fi -- 2.39.2