enable possibility to use SSH config file directory (OpenSSH >=7.3)
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
LOCALMOUNTDIR=/home/user/remote
|
||||
|
||||
## mnt-sftp.sh
|
||||
# Please insert predefined hosts in your SSH Config-file (default ~/.ssh/config). Please use keyfiles for passwordless authentication.
|
||||
SSHCONFIG=$HOME/.ssh/config
|
||||
# Please insert predefined hosts in your SSH Config-file (default ~/.ssh/config). Please use keyfiles for passwordless authentication.
|
||||
# You can also use directories, e.g. '~/.ssh/config.d/*'
|
||||
SSHCONFIG=~/.ssh/config
|
||||
|
||||
# If you don't want to use your .ssh/config file or need to define the passwords manually, you can add predefined entries here.
|
||||
# Format: user;host;port;pass;path;localpath
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
########################################################################
|
||||
# Copyright (C) 2015 Max Mehl <mail@mehl.mx>
|
||||
# Copyright (C) 2018 Max Mehl <mail@mehl.mx>
|
||||
########################################################################
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -51,8 +51,8 @@ do
|
||||
PRESSHLIST[$i]=${PREUSER[$i]}"@"${PREHOST[$i]}":"${PREPATH[$i]}
|
||||
done
|
||||
|
||||
# Read all hosts from ~/.ssh/config
|
||||
SSHLIST=$(grep -E "Host\s[[:alnum:]]" $SSHCONFIG | awk -F' ' '{ print $2 }')
|
||||
# Read all hosts from SSH config file or config directory
|
||||
SSHLIST=$(grep -rE "Host\s[[:alnum:]]" $SSHCONFIG | awk -F' ' '{ print $2 }')
|
||||
|
||||
# Choose preconfigured HOST to mount
|
||||
function mount {
|
||||
|
||||
Reference in New Issue
Block a user