#!/usr/bin/env bash ## Defined in ~/.MacOSX/environment.plist # SSH_AUTH_SOCK=${HOME}/.ssh/agent if [ -e ${SSH_AUTH_SOCK}.pid ]; then kill `cat ${SSH_AUTH_SOCK}.pid` rm -f ${SSH_AUTH_SOCK}.pid echo "ssh-agent killed" else echo "Error: ssh-agent not running" fi