Add guards before exporting the GPG Agent env variables.
This commit is contained in:
parent
17f6bb0801
commit
9e7ff8c226
2 changed files with 6 additions and 6 deletions
6
.bashrc
6
.bashrc
|
@ -37,9 +37,9 @@ fi
|
||||||
|
|
||||||
# GPG Agent
|
# GPG Agent
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
|
[ -f "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
|
||||||
export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
|
[ -f "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
|
||||||
export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
|
pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1 && export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"
|
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"
|
||||||
|
|
6
.zshrc
6
.zshrc
|
@ -41,9 +41,9 @@ fi
|
||||||
|
|
||||||
# GPG Agent
|
# GPG Agent
|
||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
|
[ -f "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent"
|
||||||
export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
|
[ -f "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh"
|
||||||
export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
|
pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1 && export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent)
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"
|
[ -f "$HOME/.aliases" ] && . "$HOME/.aliases"
|
||||||
|
|
Loading…
Reference in a new issue