Browse Source

Set database password on hubzilla restore

Bob Mottram 7 years ago
parent
commit
50c64e26ba
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      src/freedombone-app-hubzilla

+ 11
- 1
src/freedombone-app-hubzilla 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
@@ -243,6 +243,11 @@ function restore_local_hubzilla {
243 243
         if [ -d $temp_restore_dir ]; then
244 244
             rm -rf $temp_restore_dir
245 245
         fi
246
+
247
+        MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
248
+        HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
249
+        sed -i "s|\$db_pass =.*|\$db_pass = '${MARIADB_PASSWORD}';|g" $HUBZILLA_PATH/.htconfig.php
250
+        MARIADB_PASSWORD=
246 251
     fi
247 252
 }
248 253
 
@@ -278,6 +283,11 @@ function restore_remote_hubzilla {
278 283
     if [ -d /root/temphubzilla ]; then
279 284
         rm -rf /root/temphubzilla
280 285
     fi
286
+
287
+    MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
288
+    HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
289
+    sed -i "s|\$db_pass =.*|\$db_pass = '${MARIADB_PASSWORD}';|g" $HUBZILLA_PATH/.htconfig.php
290
+    MARIADB_PASSWORD=
281 291
 }
282 292
 
283 293
 function remove_hubzilla {