diff --git a/plugins/available/ssh.plugin.bash b/plugins/available/ssh.plugin.bash index 51587b29..6e082881 100644 --- a/plugins/available/ssh.plugin.bash +++ b/plugins/available/ssh.plugin.bash @@ -8,6 +8,9 @@ function add_ssh() { param '3: user' group 'ssh' + [[ $# -ne 3 ]] && echo "add_ssh host hostname user" && return 1 + [[ ! -d ~/.ssh ]] && mkdir -m 700 ~/.ssh + [[ ! -e ~/.ssh/config ]] && touch ~/.ssh/config && chmod 600 ~/.ssh/config echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config }