SSH alias now load keychain if it's not already available.

Add an mkcd alternative.
This commit is contained in:
Jeremy Gardais 2015-09-08 10:20:15 +02:00
parent 2f67336b49
commit bdc98b6de3
1 changed files with 4 additions and 2 deletions

6
zshrc
View File

@ -251,7 +251,8 @@ alias ping6="ping6 -c 3"
alias josm="java -jar -Xmx2048M /opt/josm-tested.jar" alias josm="java -jar -Xmx2048M /opt/josm-tested.jar"
## SSH ## SSH
alias ssh="test -f ~/.keychain/$HOST-sh && source ~/.keychain/$HOST-sh; ssh " # If keychain doesn't exist, load it then source the file-sh
alias ssh="[[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_rsa; source ~/.keychain/$HOST-sh; ssh "
####################################### #######################################
#Ouverture d'un programme en fonction #Ouverture d'un programme en fonction
@ -325,7 +326,8 @@ alias stat_sys="echo ' ' && uname -a && echo ' '&& uptime &&echo ' '&& df && ech
##Cree le repertoire et va dedans ##Cree le repertoire et va dedans
function mkcd() { function mkcd() {
mkdir $1 && cd $1 #mkdir $1 && cd $1
mkdir $1 && cd $_
} }