diff --git a/web/sshfs-mount b/web/sshfs-mount index bcae229..7eef9eb 100755 --- a/web/sshfs-mount +++ b/web/sshfs-mount @@ -67,14 +67,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 - # pick only string after 'sshfs' - remotepath=$( grep ^"host.*$host.*# sshfs" ~/.ssh/config \ + if grep -h -q ^"host.*$host.*# sshfs" ~/.ssh/config $HOME/.ssh/config.d/* 2>/dev/null; then + # pick only string after 'sshfs' + remotepath=$( grep -h ^"host.*$host.*# sshfs" ~/.ssh/config $HOME/.ssh/config.d/* 2>/dev/null \ | head -n 1 \ | sed "s/^host.*$host.*# sshfs//" \ | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' ) - fi fi fi path=:"${remotepath}"