Created
December 4, 2012 16:54
-
-
Save Iman/bdcdfea02408d445d34a to your computer and use it in GitHub Desktop.
gpg-agent daemon
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/bash | |
##### | |
#### GPG-AGENT stuff | |
####GET_TTY=`tty` | |
####export $GET_TTY | |
####$HOME/<somercdir>/gpg-agent-start.sh | |
##### | |
# Decide wether to start gpg-agent daemon. | |
# Create necessary symbolic link in $HOME/.gnupg/S.gpg-agent | |
SOCKET=S.gpg-agent | |
PIDOF=`pidof gpg-agent` | |
RETVAL=$? | |
if [ "$RETVAL" -eq 1 ]; then | |
echo "Starting gpg-agent daemon." | |
eval `gpg-agent --daemon ` | |
else | |
echo "Daemon gpg-agent already running." | |
fi | |
# Nasty way to find gpg-agent's socket file... | |
GPG_SOCKET_FILE=`find /tmp/gpg-* -name $SOCKET` | |
echo "Updating socket file link." | |
cp -fs $GPG_SOCKET_FILE $HOME/.gnupg/S.gpg-agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment