diff --git a/imagefiles/install-gosu-binary.sh b/imagefiles/install-gosu-binary.sh index 7a8eae6..5fb51ba 100755 --- a/imagefiles/install-gosu-binary.sh +++ b/imagefiles/install-gosu-binary.sh @@ -34,8 +34,13 @@ curl -o /usr/local/bin/gosu.asc -# -SL $url_key gpg --verify /usr/local/bin/gosu.asc # cleanup -- need to kill agent so that there is no race condition for -# agent files in $GNUPGHOME -gpgconf --kill gpg-agent +# agent files in $GNUPGHOME. Only need to do this on newer distros +# with gpgconf installed +GPGCONF_BIN="$(command -v gpgconf)" || true +if [ -n "$GPGCONF" ] && [ -x $GPGCONF_BIN ]; then + gpgconf --kill gpg-agent +fi + rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc chmod +x /usr/local/bin/gosu