summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--10_Environment.zsh18
1 files changed, 14 insertions, 4 deletions
diff --git a/10_Environment.zsh b/10_Environment.zsh
index 378dff7..303cd55 100644
--- a/10_Environment.zsh
+++ b/10_Environment.zsh
@@ -21,10 +21,20 @@ export SHELL=`which zsh`
## Agent de clefs SSH/GPG
if [ "$SUDO_USER" = "" ]
then
- KEYCHAIN=~/.keychain/$(hostname)-sh
- cmd_exists keychain && keychain --quiet
- [ -f ${KEYCHAIN} ] && source ${KEYCHAIN}
- [ -f ${KEYCHAIN}-gpg ] && source ${KEYCHAIN}-gpg
+ if cmd_exists keychain
+ then
+ if [ -f ~/.keychain/startup.zsh ]
+ then
+ ~/.keychain/startup.zsh --quiet
+ else
+ KEYCHAIN=~/.keychain/$(hostname)-sh
+ [ -f ${KEYCHAIN} ] && source ${KEYCHAIN}
+ [ -f ${KEYCHAIN}-gpg ] && source ${KEYCHAIN}-gpg
+ cmd_exists keychain && keychain --quiet --quick --inherit any --stop others
+ [ -f ${KEYCHAIN} ] && source ${KEYCHAIN}
+ [ -f ${KEYCHAIN}-gpg ] && source ${KEYCHAIN}-gpg
+ fi
+ fi
fi
## Colors