瀏覽代碼

Set database password on hubzilla restore

Bob Mottram 7 年之前
父節點
當前提交
50c64e26ba
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11
    1
      src/freedombone-app-hubzilla

+ 11
- 1
src/freedombone-app-hubzilla 查看文件

13
 # License
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
 # This program is free software: you can redistribute it and/or modify
18
 # This program is free software: you can redistribute it and/or modify
19
 # it under the terms of the GNU Affero General Public License as published by
19
 # it under the terms of the GNU Affero General Public License as published by
243
         if [ -d $temp_restore_dir ]; then
243
         if [ -d $temp_restore_dir ]; then
244
             rm -rf $temp_restore_dir
244
             rm -rf $temp_restore_dir
245
         fi
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
     fi
251
     fi
247
 }
252
 }
248
 
253
 
278
     if [ -d /root/temphubzilla ]; then
283
     if [ -d /root/temphubzilla ]; then
279
         rm -rf /root/temphubzilla
284
         rm -rf /root/temphubzilla
280
     fi
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
 function remove_hubzilla {
293
 function remove_hubzilla {