Advertisement
WhittlesJr

Untitled

Aug 4th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. # Set SSH to use gpg-agent
  2. unset SSH_AGENT_PID
  3. if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
  4.   export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
  5. fi
  6.  
  7. # Start the gpg-agent if not already running
  8. if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
  9.   gpg-connect-agent /bye >/dev/null 2>&1
  10. fi
  11.  
  12. # Set GPG TTY
  13. export GPG_TTY=$(tty)
  14.  
  15. # Refresh gpg-agent tty in case user switches into an X session
  16. gpg-connect-agent updatestartuptty /bye >/dev/null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement