drop gpg-agent scripts
This commit is contained in:
parent
98511d4b1a
commit
994dd2e07d
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
## The nice way
|
|
||||||
if test -n "${GPG_AGENT_INFO}"; then
|
|
||||||
GPG_AGENT_PID=`echo ${GPG_AGENT_INFO} | cut -d: -f2` && kill ${GPG_AGENT_PID} ||:
|
|
||||||
unset GPG_AGENT_INFO
|
|
||||||
fi
|
|
||||||
|
|
||||||
## The not so nice way
|
|
||||||
## NOTE: a root login will kill *all* users' gpg-agents
|
|
||||||
#killall gpg-agent
|
|
||||||
|
|
||||||
## clean/remove .gpg-agent-info
|
|
||||||
rm -f $HOME/.gpg-agent-info
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
GPG_AGENT=/usr/bin/gpg-agent
|
|
||||||
## Run gpg-agent only if not already running, and available
|
|
||||||
if [ -x "${GPG_AGENT}" ] ; then
|
|
||||||
|
|
||||||
# check validity of GPG_SOCKET (in case of session crash)
|
|
||||||
GPG_AGENT_INFO_FILE=${HOME}/.gpg-agent-info
|
|
||||||
if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
|
|
||||||
GPG_AGENT_PID=`cat ${GPG_AGENT_INFO_FILE} | cut -f2 -d:`
|
|
||||||
GPG_PID_NAME=`ps -p ${GPG_AGENT_PID} -o comm=`
|
|
||||||
if [ ! "x${GPG_PID_NAME}" = "xgpg-agent" ]; then
|
|
||||||
rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
|
|
||||||
else
|
|
||||||
GPG_SOCKET=`cat "${GPG_AGENT_INFO_FILE}" | cut -f1 -d:`
|
|
||||||
if ! test -S "${GPG_SOCKET}" -a -O "${GPG_SOCKET}" ; then
|
|
||||||
rm -f "${GPG_AGENT_INFO_FILE}" 2>&1 >/dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
unset GPG_AGENT_PID GPG_SOCKET GPG_PID_NAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "${GPG_AGENT_INFO_FILE}" ]; then
|
|
||||||
export GPG_AGENT_INFO=$(cat "${GPG_AGENT_INFO_FILE}")
|
|
||||||
export GPG_TTY=$(tty)
|
|
||||||
else
|
|
||||||
eval "$(${GPG_AGENT} -s --daemon ${GPG_OPTIONS})"
|
|
||||||
echo ${GPG_AGENT_INFO} > "${HOME}/.gpg-agent-info"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
Loading…
Reference in New Issue
Block a user