Bash: rename configure_ssh_host and mention author.

This commit is contained in:
Artem Sapegin 2012-11-12 16:10:05 +04:00
parent 88e3d9d426
commit 4313bea5c4
1 changed files with 5 additions and 4 deletions

View File

@ -82,7 +82,8 @@ function nyan() {
} }
# Creates an SSH key and uploads it to the given host # 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 username=$1
hostname=$2 hostname=$2
identifier=$3 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 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 fi
} }
# Adds ~/.ssh/config to the ssh autocomplete # 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 complete -W "$(awk '/^\s*Host\s*/ { sub(/^\s*Host /, ""); print; }' ~/.ssh/config)" ssh
} }
ssh_load_autocomplete _ssh_load_autocomplete