Check for empty string

This commit is contained in:
Bob Mottram 2015-11-27 08:12:04 +00:00
parent 3bc378f2a2
commit 0c4744efe4
1 changed files with 3 additions and 0 deletions

View File

@ -7556,6 +7556,9 @@ function configure_backup_key {
# Generate a GPG key for backups
BACKUP_KEY_EXISTS=$(su -c "gpg --list-keys \"$MY_NAME (backup key)\"" - $MY_USERNAME)
if [ ! $BACKUP_KEY_EXISTS ]; then
BACKUP_KEY_EXISTS='error'
fi
if [ $BACKUP_KEY_EXISTS == *"error"* ]; then
echo 'Key-Type: 1' > /home/$MY_USERNAME/gpg-genkey.conf
echo 'Key-Length: 4096' >> /home/$MY_USERNAME/gpg-genkey.conf