1 2 3 4 5 6 7 8 9 10
#!/bin/sh # add ssh-agent if found sshagent="`gdmwhich ssh-agent`" if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then command="$sshagent -- $command" elif [ -z "$sshagent" ] ; then echo "$0: ssh-agent not found!" fi