From abe546de10e73301c518b49a3d47c6489f0c43e4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 15 May 2023 09:01:00 +0200 Subject: [PATCH] gpg --- bash/alias/gpg.sh | 12 ++++++++++++ bash/gnupg.sh | 8 -------- bash/gpg.sh | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 bash/alias/gpg.sh delete mode 100644 bash/gnupg.sh create mode 100644 bash/gpg.sh diff --git a/bash/alias/gpg.sh b/bash/alias/gpg.sh new file mode 100644 index 0000000..80705c5 --- /dev/null +++ b/bash/alias/gpg.sh @@ -0,0 +1,12 @@ +# turn gpg agent off +alias gpgoff="\ +gpgconf \ +--kill \"gpg-agent\" \ +" + +# bind gpg agent to current tty +alias gpgtty="\ +gpg-connect-agent \ +updatestartuptty \ +/bye \ +" diff --git a/bash/gnupg.sh b/bash/gnupg.sh deleted file mode 100644 index ab29be1..0000000 --- a/bash/gnupg.sh +++ /dev/null @@ -1,8 +0,0 @@ -if [ ${EUID} -ne 0 ] ; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - gpg-connect-agent updatestartuptty /bye > /dev/null -fi - -alias gpgoff='gpgconf --kill gpg-agent' - -alias gpgtty='gpg-connect-agent updatestartuptty /bye' diff --git a/bash/gpg.sh b/bash/gpg.sh new file mode 100644 index 0000000..8025b64 --- /dev/null +++ b/bash/gpg.sh @@ -0,0 +1,4 @@ +if [ ${EUID} -ne 0 ] ; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + gpg-connect-agent updatestartuptty /bye > '/dev/null' +fi