gpg_ssh
This commit is contained in:
parent
68d5c0b51a
commit
763d199cde
1 changed files with 12 additions and 5 deletions
11
bash/gpg.sh
11
bash/gpg.sh
|
@ -1,5 +1,12 @@
|
||||||
if [ ${EUID} -ne 0 ] ; then
|
gpg_ssh() {
|
||||||
|
local user_id
|
||||||
|
user_id=$(id --user)
|
||||||
|
if [ "${user_id}" -ne 0 ]; then
|
||||||
if [ -f "${HOME}/.gnupg/gpg-agent.conf" ]; then
|
if [ -f "${HOME}/.gnupg/gpg-agent.conf" ]; then
|
||||||
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
||||||
|
export SSH_AUTH_SOCK
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
gpg_ssh
|
||||||
|
|
Loading…
Reference in a new issue