From bdc98b6de3c2585251ce03892bf6aec2ed5597cc Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 8 Sep 2015 10:20:15 +0200 Subject: [PATCH] SSH alias now load keychain if it's not already available. Add an mkcd alternative. --- zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index ff6fb6d..505d4eb 100644 --- a/zshrc +++ b/zshrc @@ -251,7 +251,8 @@ alias ping6="ping6 -c 3" alias josm="java -jar -Xmx2048M /opt/josm-tested.jar" ## 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 @@ -325,7 +326,8 @@ alias stat_sys="echo ' ' && uname -a && echo ' '&& uptime &&echo ' '&& df && ech ##Cree le repertoire et va dedans function mkcd() { - mkdir $1 && cd $1 + #mkdir $1 && cd $1 + mkdir $1 && cd $_ }