Check if an error is returned when getting public key ID

This commit is contained in:
Bob Mottram 2017-09-18 21:36:00 +01:00
parent ad02634386
commit 9804c49a2c
1 changed files with 9 additions and 5 deletions

View File

@ -1381,11 +1381,15 @@ function configure_gpg {
if [ ${#MY_GPG_PUBLIC_KEY_ID} -lt 4 ]; then
echo $'GPG public key ID could not be obtained'
else
chown -R $MY_USERNAME:$MY_USERNAME $gpg_dir
chmod 700 $gpg_dir
chmod 600 $gpg_dir/*
mark_completed $FUNCNAME
return
if [[ "$MY_GPG_PUBLIC_KEY_ID" == *'error'* ]]; then
echo $"Can't locate gpg key"
else
chown -R $MY_USERNAME:$MY_USERNAME $gpg_dir
chmod 700 $gpg_dir
chmod 600 $gpg_dir/*
mark_completed $FUNCNAME
return
fi
fi
fi