Created
October 25, 2010 09:08
-
-
Save gifnksm/644649 to your computer and use it in GitHub Desktop.
ssh-agentをターミナル間で共有する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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