Check for empty string

This commit is contained in:
Bob Mottram 2015-11-27 08:09:36 +00:00
parent ee8870fd7d
commit 3bc378f2a2
1 changed files with 4 additions and 2 deletions

View File

@ -7548,9 +7548,11 @@ function configure_backup_key {
apt-get -y install gnupg
BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)")
if [ $BACKUP_KEY_EXISTS ]; then
if [ $BACKUP_KEY_EXISTS != *"error"* ]; then
return
fi
fi
# Generate a GPG key for backups
BACKUP_KEY_EXISTS=$(su -c "gpg --list-keys \"$MY_NAME (backup key)\"" - $MY_USERNAME)