# Author: Maxime DERCHE # Date: January 8th 2014 # Based on: * /etc/X11/xinit/xinitrc on OpenBSD # * # With help from the #OpenBSD.fr people. Thanks. ,-) # Use case: workstation ssh_agent_path=/usr/bin/ssh-agent ssh_add_path=/usr/bin/ssh-add key_lifetime="2h" ecdsa_key=$HOME/.ssh/id_ecdsa rsa_key=$HOME/.ssh/id_rsa # First, we see if ssh-agent is already running or not. if [ -z "$SSH_AGENT_PID" ] && [ -x "$ssh_agent_path" ]; then eval `$ssh_agent_path -s -t $key_lifetime` fi # Then we load the keys in ssh-agent. if [ -x "$ssh_add_path" ]; then if [ -f $ecdsa_key ]; then $ssh_add_path -t $key_lifetime $ecdsa_key < /dev/null fi if [ -f $rsa_key ]; then $ssh_add_path -t $key_lifetime $rsa_key < /dev/null fi fi