From ab1abfe4963baa28a2d615a0e79fe983f25dfaeb Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 17 Feb 2016 10:49:03 +0000 Subject: [PATCH] Simplified SSH interaction. --- .bashrc | 24 +++--------------------- bin/software-install.sh | 1 - 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/.bashrc b/.bashrc index 9521fee..d7b8ad6 100644 --- a/.bashrc +++ b/.bashrc @@ -89,28 +89,10 @@ export GOPATH=${HOME}/src/go #-------------------------------------------------------------------------------- # Run an SSH agent, if possible #-------------------------------------------------------------------------------- -SSH_ENV="$HOME/.ssh/environment" - -function start_agent { - echo -n "Initialising new SSH agent... " - ssh-agent 2> /dev/null | sed 's/^echo/#echo/' > "${SSH_ENV}" - pgrep ssh-agent > /dev/null && echo "succeeded" || echo "failed" - chmod 0600 "${SSH_ENV}" - . "${SSH_ENV}" > /dev/null - ssh-add ~/.ssh/scott@wallace.sh -} - # Check if we already have an agent running and sourced -if [ -z "${SSH_AUTH_SOCK}" -a -n "${PS1}" ]; then - # Source SSH settings, if applicable - if [ -f "${SSH_ENV}" ]; then - . "${SSH_ENV}" > /dev/null - pgrep ssh-agent | grep -E "^${SSH_AGENT_PID}" > /dev/null || { - start_agent - } - else - start_agent - fi +if [ -z "${SSH_AUTH_SOCK}" ]; then + eval `ssh-agent -s` + ssh-add fi #-------------------------------------------------------------------------------- diff --git a/bin/software-install.sh b/bin/software-install.sh index 89363d4..663e29a 100755 --- a/bin/software-install.sh +++ b/bin/software-install.sh @@ -44,7 +44,6 @@ function install_osx_software { mosh python3 vim - homebrew/dupes/openssh EOF #-------------------------------