Skip to content

Commit

Permalink
toggle agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Papperello committed Jul 31, 2018
1 parent 1c32f0e commit 8deb08c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,14 @@ else
eval $(gpg-agent --daemon --enable-ssh-support --sh)
fi



function toggle-agent {
if [[ $SSH_AUTH_SOCK =~ gpg ]]
then
export SSH_AUTH_SOCK=$(ls /private/tmp/com.apple.launchd.*/Listeners )
else
export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
fi

}

0 comments on commit 8deb08c

Please sign in to comment.