From f4c195e8c7beacaf5f781e0d30c273b57ccad21f Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 8 May 2014 12:01:11 +0200 Subject: [PATCH] gpg-agent included --- gpg-agent.conf | 2 ++ gpg-agent.sh | 10 ++++++++++ install | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 gpg-agent.conf create mode 100644 gpg-agent.sh diff --git a/gpg-agent.conf b/gpg-agent.conf new file mode 100644 index 0000000..20193f1 --- /dev/null +++ b/gpg-agent.conf @@ -0,0 +1,2 @@ +pinentry-program /usr/bin/pinentry-curses +default-cache-ttl 3600 diff --git a/gpg-agent.sh b/gpg-agent.sh new file mode 100644 index 0000000..33c6451 --- /dev/null +++ b/gpg-agent.sh @@ -0,0 +1,10 @@ +if [ $EUID -ne 0 ] ; then + envfile="$HOME/.gnupg/gpg-agent.env" + if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" + else + eval "$(gpg-agent --daemon --enable-ssh-support --write-env-file "$envfile")" + fi + export GPG_AGENT_INFO # the env file does not contain the export statement + export SSH_AUTH_SOCK # enable gpg-agent for ssh +fi diff --git a/install b/install index 2972749..e44388c 100755 --- a/install +++ b/install @@ -5,8 +5,10 @@ cp -if `pwd`/.bashrc ~/.bashrc || true cp -if `pwd`/muttrc ~/.mutt/muttrc || true cp -if `pwd`/msmtp ~/.mutt/msmtp || true cp -if `pwd`/offlineimaprc ~/.mutt/offlineimaprc || true +cp -if `pwd`/gpg-agent.conf ~/.gnupg/gpg-agent.conf || true sudo cp -if `pwd`/sudo/mpd.conf /etc/mpd.conf || true sudo cp -if `pwd`/sudo/settings.json /etc/transmission-daemon/settings.json || true +sudo cp -if `pwd`/gpg-agent.sh /etc/profile.d/gpg-agent.sh || true if [ "$1" = "-x" ] then -- 2.20.1