Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37533853
en ru br
ALT Linux repos
S:2.4.3-alt1
5.0: 2.0.11-alt2.M50.1
4.1: 2.0.14-alt1.M41.1
4.0: 2.0.9-alt2.M40.1
3.0: 1.9.17-alt2

Other repositories
Upstream:2.0.8

Group :: Text tools
RPM: gnupg2

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh -efu

[ -n "${GNUPGHOME-}" ] || GNUPGHOME="$HOME/.gnupg"
INFO="$GNUPGHOME/.gpg-agent-info"
>>"$INFO"
enable -f /usr/lib/bash/lockf lockf
builtin lockf "$INFO"

check_agent()
{
[ -s "$INFO" ] &&
pid="$(sed -n 's|^GPG_AGENT_INFO=/[^:]\+:\([1-9][0-9]*\):[^:]\+$|\1|p' <"$INFO")" &&
[ -n "$pid" ] &&
kill -0 "$pid" 2>/dev/null
}

check_agent && exit

# Launch seahorse-agent iff
# $DISPLAY is set AND
# (EITHER (pinentry-program is set to seahorse-agent in gpg-agent.conf)
# OR (no pinentry-program is set in gpg-agent.conf AND seahorse-agent is installed))
# Otherwise launch gpg-agent.

use_seahorse=
if [ -n "${DISPLAY-}" ]; then
CFG="$GNUPGHOME/gpg-agent.conf"
if grep -qs '^[[:space:]]*pinentry-program[[:space:]]\+.*seahorse-agent' "$CFG"; then
use_seahorse=1
elif ! grep -qs '^[[:space:]]*pinentry-program[[:space:]]' "$CFG" &&
type seahorse-agent >/dev/null 2>&1; then
use_seahorse=1
fi
fi

if [ -n "$use_seahorse" ]; then
a=seahorse-agent; $a --variables >"$INFO"
else
gpg-agent --daemon >"$INFO"
fi

check_agent
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin