gpg agent
This commit is contained in:
parent
dec800c3d0
commit
6cb16f170a
@ -61,6 +61,25 @@ if ! shopt -oq posix; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x "/usr/bin/gpg-agent" ]; then
|
||||
GPG_ENV="$HOME/.gnupg/environment"
|
||||
|
||||
function __start_agent {
|
||||
gpg-agent --daemon > "${GPG_ENV}"
|
||||
chmod 600 "${GPG_ENV}"
|
||||
. "${GPG_ENV}" > /dev/null
|
||||
}
|
||||
|
||||
if [ -f "${GPG_ENV}" ]; then
|
||||
. "${GPG_ENV}" > /dev/null
|
||||
|
||||
gpg-agent > /dev/null 2>&1
|
||||
[ "$?" -ne 0 ] && { __start_agent; }
|
||||
else
|
||||
__start_agent;
|
||||
fi
|
||||
fi
|
||||
|
||||
BASHL_UUID="<UUID>"
|
||||
export BASH_SDIR=/tmp/$BASHL_UUID
|
||||
[ ! -d "$BASH_SDIR" ] && mkdir "$BASH_SDIR"
|
||||
|
Loading…
Reference in New Issue
Block a user