From b8011843d13bfdc1151ad81e4a5b7e04ca42909e Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 27 Sep 2017 16:26:41 +0200 Subject: [PATCH] Wait 5*5 secs for network to be up (sats-install) --- clone/utility/sats-install | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/clone/utility/sats-install b/clone/utility/sats-install index 8345571..fe25597 100644 --- a/clone/utility/sats-install +++ b/clone/utility/sats-install @@ -30,10 +30,18 @@ fi; # (x) If no network -> exit # slog " * 4. Checking connectivity"; -[ -z "`ping xdrm.io -q -c 1 -i 1 2>&1 > /dev/null`" ] \ - && slog " > done" \ - || failexit; +max_try=5; +while [ -n "`ping xdrm.io -q -c 1 -i 1 2>&1 > /dev/null`" ]; do + slog " > waiting for network"; + + max_try=`expr $max_try - 1`; + [ $max_try -lt 0 ] && failexit; + + sleep 5; +done; + +slog " > done"; # [1] Installation #========================================================#