From 2b892204e2cc39f80b69af20d68d664241dc2037 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 22 May 2019 13:13:13 -0400 Subject: [PATCH] install-gosu-binary: Run gpgconf --kill only if option is available --- imagefiles/install-gosu-binary.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imagefiles/install-gosu-binary.sh b/imagefiles/install-gosu-binary.sh index fec9ddd..34a9fb3 100755 --- a/imagefiles/install-gosu-binary.sh +++ b/imagefiles/install-gosu-binary.sh @@ -35,10 +35,10 @@ gpg --verify /usr/local/bin/gosu.asc # cleanup -- need to kill agent so that there is no race condition for # agent files in $GNUPGHOME. Only need to do this on newer distros -# with gpgconf installed +# with gpgconf installed supporting the option. GPGCONF_BIN="$(command -v gpgconf)" || true -if [ -n "$GPGCONF_BIN" ] && [ -x $GPGCONF_BIN ]; then - gpgconf --kill gpg-agent +if [ -n "$GPGCONF_BIN" ] && [ -x $GPGCONF_BIN ] && [[ $($GPGCONF_BIN --help | grep -- "--kill" || true) != "" ]]; then + gpgconf --kill gpg-agent fi rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc