X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhsign.sh;h=9a060532e2ef4c23d48ab044b67625858090edb1;hb=bc38ebb2e95e0a4d4a672b49366130f433e72aec;hp=e6f54b39d8a6470508ad0860124841c69f5d5c46;hpb=00e24678854acd95c3cac1e49c8aafb6010dfdb9;p=mmh 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