# Author: Maxime DERCHE # Date: January 9th 2014 # Based on: * /etc/X11/xinit/xinitrc on OpenBSD # * # With help from the #OpenBSD.fr people. Thanks. ,-) # Use case: SSH gateway ssh_agent_path=/usr/bin/ssh-agent ssh_add_path=/usr/bin/ssh-add ssh_env="$HOME/.ssh/environment" key_lifetime="4h" ecdsa_key=$HOME/.ssh/id_ecdsa rsa_key=$HOME/.ssh/id_rsa if [ -z `pgrep -u "$LOGNAME" ssh-agent` ] && [ -x "$ssh_agent_path" ]; then $ssh_agent_path -s -t $key_lifetime > $ssh_env chmod 600 $ssh_env fi eval `cat $ssh_env` if [ -x "$ssh_add_path" ]; then if [ -f $ecdsa_key ] && [ -z `"$ssh_add_path" -l | grep ECDSA` ]; then $ssh_add_path -t $key_lifetime $ecdsa_key < /dev/null fi if [ -f $rsa_key ] && [ -z `"$ssh_add_path" -l | grep RSA` ]; then $ssh_add_path -t $key_lifetime $rsa_key < /dev/null fi fi