get paths from config.d
This commit is contained in:
@@ -67,16 +67,14 @@ mkdir -p ~/mnt
|
|||||||
|
|
||||||
valid_name=$( echo "$host" | sed -e 's/[^A-Za-z0-9._@-]//g')
|
valid_name=$( echo "$host" | sed -e 's/[^A-Za-z0-9._@-]//g')
|
||||||
if [[ -z "$remotepath" ]]; then
|
if [[ -z "$remotepath" ]]; then
|
||||||
if [[ -e ~/.ssh/config ]]; then
|
if grep -h -q ^"host.*$host.*# sshfs" ~/.ssh/config $HOME/.ssh/config.d/* 2>/dev/null; then
|
||||||
if grep -q ^"host.*$host.*# sshfs" ~/.ssh/config; then
|
|
||||||
# pick only string after 'sshfs'
|
# pick only string after 'sshfs'
|
||||||
remotepath=$( grep ^"host.*$host.*# sshfs" ~/.ssh/config \
|
remotepath=$( grep -h ^"host.*$host.*# sshfs" ~/.ssh/config $HOME/.ssh/config.d/* 2>/dev/null \
|
||||||
| head -n 1 \
|
| head -n 1 \
|
||||||
| sed "s/^host.*$host.*# sshfs//" \
|
| sed "s/^host.*$host.*# sshfs//" \
|
||||||
| sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' )
|
| sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' )
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
path=:"${remotepath}"
|
path=:"${remotepath}"
|
||||||
|
|
||||||
if [[ "$nosave" = true ]]; then
|
if [[ "$nosave" = true ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user