diff --git a/web/sshfs-mount b/web/sshfs-mount index 6f21b08..52de555 100755 --- a/web/sshfs-mount +++ b/web/sshfs-mount @@ -68,9 +68,12 @@ mkdir -p ~/mnt valid_name=$( echo "$host" | sed -e 's/[^A-Za-z0-9._@-]//g') if [[ -z "$remotepath" ]]; then if [[ -e ~/.ssh/config ]]; then - if grep -q ^"host $host # sshfs" ~/.ssh/config; then + if grep -q ^"host.*$host.*# sshfs" ~/.ssh/config; then # pick only string after 'sshfs' - remotepath=$( grep ^"host $host # sshfs" ~/.ssh/config | head -n 1 | sed "s/^host $host # sshfs //" ) + remotepath=$( grep ^"host.*$host.*# sshfs" ~/.ssh/config \ + | head -n 1 \ + | sed "s/^host.*$host.*# sshfs//" \ + | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' ) fi fi fi