So, without further ado:
If you're in a situation where ssh-agent isn't running farther up in your process tree automatically, here's how to get the same functionality out of .bashrc.
export EDITOR=/usr/bin/vim
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
1 comment:
The syntax highlighting on this page isn't quite right yet. I'm leaving it broken as I've submitted this page as an example in the bug report to SyntaxHighlighter. The view source link does give you the correct text. Once the kinks are ironed out, I'll post (yet another) howto for getting it working with Blogger.
Post a Comment