Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > a4ff8a39aeb389e65f8beff545f4e9e0 > files > 3

keychain-2.5.5-2mdk.src.rpm

#!/bin/sh
# This sources $HOME/.keychain/$HOSTNAME-sh and
# $HOME/.keychain/$HOSTNAME-sh-gpg, to get the ssh-agent and gpg-agent
# started by keychain.
# Keychain is also started.
# By default keychain will only inherit local agents, if you want it to
# inherit forwarding agents set $KEYCHAIN_OPTIONS in $HOME/.keychain/config
# to something like "--inherit any-once"

KEYS=""

[ -e "$HOME/.keychain/config" ] && . "$HOME/.keychain/config"

for i in identity id_rsa id_dsa;do
        [ -e "$HOME/.ssh/$i" ] && KEYS="$KEYS $HOME/.ssh/$i"
done

if [ -e "$HOME/.gnupg/gpg.conf" -a -z "$GPGKEY" ]
    then GPGKEY=`awk '/^default-key/ {print $2}' "$HOME/.gnupg/gpg.conf"`
fi

[ -n "$GPGKEY" ] && KEYS="$KEYS $GPGKEY"

if [ -x /usr/bin/keychain -a -d ~/.keychain ]; then
        keychain -q -Q $KEYCHAIN_OPTIONS $KEYS
fi

KEYCHAINFILE=$HOME/.keychain/$HOSTNAME-sh

[ -e $KEYCHAINFILE ] && . $KEYCHAINFILE

KEYCHAINFILEGPG=$HOME/.keychain/$HOSTNAME-sh-gpg

[ -e $KEYCHAINFILEGPG ] && . $KEYCHAINFILEGPG