Created
April 6, 2016 09:01
-
-
Save JorgenEvens/5f3ea0c1a1048f06b697326425f3bd4b to your computer and use it in GitHub Desktop.
A fallback for gpg-connect-agent on OSX when using Oh-My-Zsh gpg-agent plugin and gnupg from Homebrew.
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
#!/bin/sh | |
GPG_ENV=$HOME/.gnupg/gpg-agent.env | |
if [ ! -f "${GPG_ENV}" ]; then | |
>&2 echo "GPG_ENV not found" | |
echo "GPG_ENV not found" >> /tmp/gpg-agent | |
exit 1 | |
fi | |
if [ ! -S "${GPG_AGENT_INFO//:*/}" ]; then | |
>&2 echo "GPG_AGENT_INFO does not point to a socket" | |
exit 2 | |
fi | |
pgrep "gpg-agent" > /dev/null | |
if [ ! $? -eq 0 ]; then | |
>&2 echo "gpg-agent not running" | |
exit 3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment