Browse Source

Check for empty string

Bob Mottram 9 years ago
parent
commit
0c4744efe4
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/freedombone

+ 3
- 0
src/freedombone View File

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