Skip to content

Instantly share code, notes, and snippets.

@gifnksm
Created October 25, 2010 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gifnksm/644649 to your computer and use it in GitHub Desktop.
Save gifnksm/644649 to your computer and use it in GitHub Desktop.
ssh-agentをターミナル間で共有する
function ssh-start() {
ssh-agent -s > "${HOME}/.ssh/agent-env"
. "${HOME}/.ssh/agent-env"
ssh-add
}
if [ -e "${HOME}/.ssh/agent-env" ]; then
isAliveAgent=`ps -ef | grep "/ssh-agent" | grep -v grep | wc -l`
if [ $isAliveAgent = 1 ]; then
echo "ssh-agent is alive"
. "${HOME}/.ssh/agent-env"
else
echo "ssh-agent is not alive"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment