#!/bin/sh # Simple ssh-agent manager for POSIX systems. Made to work with cygwin. # To add to your startup, # curl http://www.omgwallhack.org/home/jrayhawk/src/envagent.sh.txt >> ~/.bashrc if [ -e ~/.ssh/env ]; then source ~/.ssh/env if [ "$(readlink /proc/$SSH_AGENT_PID/exe)" != /usr/bin/ssh-agent ] || ! kill -0 $SSH_AGENT_PID; then # std output should be kept pristine for subsystems and direct command invocation ssh-agent | grep -v echo > ~/.ssh/env source ~/.ssh/env fi else ssh-agent | grep -v echo > ~/.ssh/env source ~/.ssh/env fi