From: Daniel Kahn Gillmor Date: Thu, 19 Feb 2009 05:35:50 +0000 (-0500) Subject: catch pipe failures more cleanly during key import X-Git-Tag: monkeysphere_0.23~58^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a7b42ec39aad2e774255b875af7ab40e80bb872;p=monkeysphere.git catch pipe failures more cleanly during key import --- diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier index 2f29759..7c1441c 100644 --- a/src/share/ma/add_certifier +++ b/src/share/ma/add_certifier @@ -84,7 +84,8 @@ if [ -f "$keyID" ] ; then # + failure 'could not read key from '\''/root/dkg.gpg'\''' # + echo 'could not read key from '\''/root/dkg.gpg'\''' - keyID=$(echo "$importinfo" | grep '^gpg: key ' | cut -f2 -d: | cut -f3 -d\ ) + keyID=$(echo "$importinfo" | grep '^gpg: key ' | cut -f2 -d: | cut -f3 -d\ ) || \ + failure "There were no gpg keys in the file." if [ -z "$keyID" ] || [ $(echo "$keyID" | wc -l) -ne 1 ] ; then failure "There was not exactly one gpg key in the file." fi