From 4313bea5c4643c6afbf84afe47249f5dc0a06e70 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Mon, 12 Nov 2012 16:10:05 +0400 Subject: [PATCH] Bash: rename configure_ssh_host and mention author. --- includes/bash_functions.bash | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 6b7d46e..a4bf8df 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -82,7 +82,8 @@ function nyan() { } # Creates an SSH key and uploads it to the given host -configure_ssh_host() { +# Based on https://gist.github.com/1761938 +add-ssh-host() { username=$1 hostname=$2 identifier=$3 @@ -103,12 +104,12 @@ configure_ssh_host() { tput bold; ssh -o PasswordAuthentication=no $identifier true && { tput setaf 2; echo "SSH key added."; } || { tput setaf 1; echo "Failure"; }; tput sgr0 - ssh_load_autocomplete + _ssh_load_autocomplete fi } # Adds ~/.ssh/config to the ssh autocomplete -ssh_load_autocomplete() { +_ssh_load_autocomplete() { complete -W "$(awk '/^\s*Host\s*/ { sub(/^\s*Host /, ""); print; }' ~/.ssh/config)" ssh } -ssh_load_autocomplete \ No newline at end of file +_ssh_load_autocomplete \ No newline at end of file