summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cryptfs.bin.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/cryptfs.bin.in b/cryptfs.bin.in
index fd172cd..a7a6ee1 100644
--- a/cryptfs.bin.in
+++ b/cryptfs.bin.in
@@ -14,6 +14,22 @@ else
exit 1
fi
+extract_ssh_host() {
+ {
+ printf '%s\n' "$1"
+ if [ -f ~/.ssh/config ]; then
+ sed '
+ /^Host\s\+'"$1"'$/,/^Host\s/ {
+ s/^\s*Hostname\s\+//
+ t
+ }
+ d
+ ' ~/.ssh/config
+ fi
+ } \
+ | tail -n1
+}
+
give_all_parent_dirs() {
local odir
local dir
@@ -185,6 +201,7 @@ do_mount() {
mount_details dev "$1" | \
sed 's>^\([^:@]*@\)\?\([^:@]\+\):\S*$>\2>'
)
+ host=$(extract_ssh_host "${host}")
while [ $(date +%s) -lt ${max_wait} ] && \
! #PING6# -c1 "${host}" >/dev/null 2>&1 && \
! ping -c1 "${host}" >/dev/null 2>&1; do