Last active
October 25, 2019 07:12
-
-
Save Lunik/d41b9409cd7eada5b462f6704b23b6f9 to your computer and use it in GitHub Desktop.
Agent loading in bashrc
This file contains hidden or 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
# GPG | |
function start_gpg_agent() { | |
echo "[GPG] Starting agent" | |
gpg-agent --daemon 2>&1 >/dev/null | |
} | |
gpg_daemon_pid=$(pgrep gpg-agent) | |
ping_process=$(kill -0 "${gpg_daemon_pid}" 2>&1 >/dev/null) | |
if [ "$?" -ne "0" ]; then | |
start_gpg_agent | |
fi | |
GPG_TTY=$(tty) | |
export GPG_TTY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment