Browse Source

Set database password on movim restore

Bob Mottram 7 years ago
parent
commit
e279bce875
3 changed files with 13 additions and 2 deletions
  1. 1
    1
      src/freedombone-app-lychee
  2. 1
    1
      src/freedombone-app-mediagoblin
  3. 11
    0
      src/freedombone-app-movim

+ 1
- 1
src/freedombone-app-lychee View File

@@ -13,7 +13,7 @@
13 13
 # License
14 14
 # =======
15 15
 #
16
-# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
17 17
 #
18 18
 # This program is free software: you can redistribute it and/or modify
19 19
 # it under the terms of the GNU Affero General Public License as published by

+ 1
- 1
src/freedombone-app-mediagoblin View File

@@ -13,7 +13,7 @@
13 13
 # License
14 14
 # =======
15 15
 #
16
-# Copyright (C) 2016 Bob Mottram <bob@freedombone.net>
16
+# Copyright (C) 2016-2017 Bob Mottram <bob@freedombone.net>
17 17
 #
18 18
 # This program is free software: you can redistribute it and/or modify
19 19
 # it under the terms of the GNU Affero General Public License as published by

+ 11
- 0
src/freedombone-app-movim View File

@@ -216,6 +216,11 @@ function restore_local_movim {
216 216
             rm -rf $temp_restore_dir
217 217
         fi
218 218
 
219
+        MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
220
+        cd /var/www/$MOVIM_DOMAIN_NAME/htdocs/config
221
+        sed -i "s|'password'.*|'password'    => '$MARIADB_PASSWORD',|g" db.inc.php
222
+        MARIADB_PASSWORD=
223
+
219 224
         echo $"Restore of movim complete"
220 225
     fi
221 226
 }
@@ -259,6 +264,12 @@ function restore_remote_movim {
259 264
         if [ -d /root/tempmovim ]; then
260 265
             rm -rf /root/tempmovim
261 266
         fi
267
+
268
+        MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
269
+        cd /var/www/$MOVIM_DOMAIN_NAME/htdocs/config
270
+        sed -i "s|'password'.*|'password'    => '$MARIADB_PASSWORD',|g" db.inc.php
271
+        MARIADB_PASSWORD=
272
+
262 273
         echo $"Restore of movim complete"
263 274
     fi
264 275
 }