From b7c8f901194c237fd748882524bcb7c4ddc8121a Mon Sep 17 00:00:00 2001 From: Q Date: Sun, 10 Aug 2025 14:34:24 +0300 Subject: [PATCH] get paths from config.d --- web/sshfs-mount | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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}"