From a8d723559a90dc60857e66f957d4679d3303d49e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 24 Mar 2017 20:18:54 +0100 Subject: now waits until host is pingable --- cryptfs.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cryptfs.in b/cryptfs.in index 9d5b35f..173cee3 100644 --- a/cryptfs.in +++ b/cryptfs.in @@ -48,6 +48,17 @@ start) sleep 1 maxWait=$[${maxWait}-1] done + host="$( + echo "${fsTab}" | \ + grep -m1 "^\(ssh\|ftp\)fs#\S*\s\+${neededKeyFs}\s" | \ + sed "s>^\(ssh\|ftp\)fs#\([^ :@]*@\)\?\([^ :@]\+\)\(:\S\+\)\?\s\+${neededKeyFs}\s.*$>\3>" + )" + while [ ${maxWait} -gt 0 ] && ! /bin/ping -c1 ${host} &> /dev/null + do + >&2 echo -ne "," + sleep 1 + maxWait=$[${maxWait}-1] + done fi mount ${neededKeyFs} || exit $? fi -- cgit v1.2.3-70-g09d2