Explorar el Código

Check if database password file exists

Bob Mottram hace 9 años
padre
commit
036cbad80a
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. 4
    1
      src/freedombone-restore-local
  2. 4
    1
      src/freedombone-restore-remote

+ 4
- 1
src/freedombone-restore-local Ver fichero

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 Ver fichero

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"