Browse Source

Check if database password file exists

Bob Mottram 8 years ago
parent
commit
036cbad80a
2 changed files with 8 additions and 2 deletions
  1. 4
    1
      src/freedombone-restore-local
  2. 4
    1
      src/freedombone-restore-remote

+ 4
- 1
src/freedombone-restore-local View File

@@ -66,7 +66,10 @@ if [ -f $COMPLETION_FILE ]; then
66 66
 fi
67 67
 
68 68
 # MariaDB password
69
-DATABASE_PASSWORD=$(cat /root/dbpass)
69
+DATABASE_PASSWORD=''
70
+if [ -f /root/dbpass ]; then
71
+    DATABASE_PASSWORD=$(cat /root/dbpass)
72
+fi
70 73
 
71 74
 function check_backup_exists {
72 75
     if [ ! -d $USB_MOUNT/backup ]; then

+ 4
- 1
src/freedombone-restore-remote View File

@@ -94,7 +94,10 @@ else
94 94
 fi
95 95
 
96 96
 # MariaDB password
97
-DATABASE_PASSWORD=$(cat /root/dbpass)
97
+DATABASE_PASSWORD=''
98
+if [ -f /root/dbpass ]; then
99
+    DATABASE_PASSWORD=$(cat /root/dbpass)
100
+fi
98 101
 
99 102
 function copy_gpg_keys {
100 103
     echo $"Copying GPG keys from admin user to root"