Przeglądaj źródła

Set database password on friendica restore

Bob Mottram 7 lat temu
rodzic
commit
c1cf74c0d4
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10
    0
      src/freedombone-app-friendica

+ 10
- 0
src/freedombone-app-friendica Wyświetl plik

@@ -252,6 +252,11 @@ function restore_local_friendica {
252 252
         if [ -d $temp_restore_dir ]; then
253 253
             rm -rf $temp_restore_dir
254 254
         fi
255
+
256
+        MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
257
+        FRIENDICA_PATH=/var/www/$FRIENDICA_DOMAIN_NAME/htdocs
258
+        sed -i "s|\$db_pass =.*|\$db_pass = '${MARIADB_PASSWORD}';|g" $FRIENDICA_PATH/.htconfig.php
259
+        MARIADB_PASSWORD=
255 260
     fi
256 261
 }
257 262
 
@@ -287,6 +292,11 @@ function restore_remote_friendica {
287 292
     if [ -d /root/tempfriendica ]; then
288 293
         rm -rf /root/tempfriendica
289 294
     fi
295
+
296
+    MARIADB_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb)
297
+    FRIENDICA_PATH=/var/www/$FRIENDICA_DOMAIN_NAME/htdocs
298
+    sed -i "s|\$db_pass =.*|\$db_pass = '${MARIADB_PASSWORD}';|g" $FRIENDICA_PATH/.htconfig.php
299
+    MARIADB_PASSWORD=
290 300
 }
291 301
 
292 302
 function remove_friendica {