From f36530fd658fd2ccfac328c5097f7b44712eceac Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 25 Nov 2014 07:01:31 +0100 Subject: [PATCH] mhsign: Bugfix: Don't ignore MMHPGPKEY and the Pgpkey profile entry. Bugreport and patch by Philipp Takacs . Thanks. Additionally: use `test -z'. --- uip/mhsign.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uip/mhsign.sh b/uip/mhsign.sh index e6f54b3..9a06053 100755 --- a/uip/mhsign.sh +++ b/uip/mhsign.sh @@ -18,12 +18,14 @@ function=sign # find out the signing key userid="$MMHPGPKEY" -if [ "x$userid" = "x" ] ; then +if [ -z "$userid" ] ; then userid="`mhparam pgpkey`" fi -userid="`gpg --list-secret-keys --with-colons 2>/dev/null | - sed -n '/^sec/{p;q;}' | cut -d: -f5`" -if [ "x$userid" = x ] ; then +if [ -z "$userid" ] ; then + userid="`gpg --list-secret-keys --with-colons 2>/dev/null | + sed -n '/^sec/{p;q;}' | cut -d: -f5`" +fi +if [ -z "$userid" ] ; then echo "No secret key found" >&2 exit 1 fi -- 1.7.10.4