From 5dc85c071d7b3cb18d3086d49ba374d7dac1c430 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 4 May 2016 09:29:08 +0100 Subject: [PATCH] Test for error --- src/freedombone-controlpanel-user | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedombone-controlpanel-user b/src/freedombone-controlpanel-user index fc555513..b33b6828 100755 --- a/src/freedombone-controlpanel-user +++ b/src/freedombone-controlpanel-user @@ -702,12 +702,12 @@ function sign_gpg_key { if [ ${#SIGN_ADDRESS} -gt 2 ]; then clear fpr=$(gpg --with-colons --fingerprint "$SIGN_ADDRESS" | grep fpr | head -n 1 | awk -F ':' '{print $10}') - if [[ $fpr == *"error"* ]]; then + if [ ! "$?" = "0" ]; then gpg --search "$SIGN_ADDRESS" fpr=$(gpg --with-colons --fingerprint "$SIGN_ADDRESS" | grep fpr | head -n 1 | awk -F ':' '{print $10}') fi - if [[ $fpr != *"error"* ]]; then + if [ ! "$?" = "0" ]; then if [ ${#fpr} -gt 2 ]; then gpg --sign-key $fpr if [ "$?" = "0" ]; then