From: markus schnalke Date: Tue, 25 Nov 2014 06:01:31 +0000 (+0100) Subject: mhsign: Bugfix: Don't ignore MMHPGPKEY and the Pgpkey profile entry. X-Git-Tag: mmh-0.2-RC1~98 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=f36530fd658fd2ccfac328c5097f7b44712eceac;p=mmh mhsign: Bugfix: Don't ignore MMHPGPKEY and the Pgpkey profile entry. Bugreport and patch by Philipp Takacs . Thanks. Additionally: use `test -z'. --- 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