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 if [ ${#MY_GPG_PUBLIC_KEY_ID} -lt 4 ]; then
echo $'GPG public key ID could not be obtained' echo $'GPG public key ID could not be obtained'
else else
chown -R $MY_USERNAME:$MY_USERNAME $gpg_dir if [[ "$MY_GPG_PUBLIC_KEY_ID" == *'error'* ]]; then
chmod 700 $gpg_dir echo $"Can't locate gpg key"
chmod 600 $gpg_dir/* else
mark_completed $FUNCNAME chown -R $MY_USERNAME:$MY_USERNAME $gpg_dir
return chmod 700 $gpg_dir
chmod 600 $gpg_dir/*
mark_completed $FUNCNAME
return
fi
fi fi
fi fi