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
 fi
66
 fi
67
 
67
 
68
 # MariaDB password
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
 function check_backup_exists {
74
 function check_backup_exists {
72
     if [ ! -d $USB_MOUNT/backup ]; then
75
     if [ ! -d $USB_MOUNT/backup ]; then

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

94
 fi
94
 fi
95
 
95
 
96
 # MariaDB password
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
 function copy_gpg_keys {
102
 function copy_gpg_keys {
100
     echo $"Copying GPG keys from admin user to root"
103
     echo $"Copying GPG keys from admin user to root"