Parcourir la source

Backup and restore matrix identity server

Bob Mottram il y a 8 ans
Parent
révision
a0972bab26
1 fichiers modifiés avec 28 ajouts et 0 suppressions
  1. 28
    0
      src/freedombone-app-matrix

+ 28
- 0
src/freedombone-app-matrix Voir le fichier

342
         if [ -d $source_directory ]; then
342
         if [ -d $source_directory ]; then
343
             backup_directory_to_usb $source_directory matrixdata
343
             backup_directory_to_usb $source_directory matrixdata
344
         fi
344
         fi
345
+        source_directory=/etc/sydent
346
+        if [ -d $source_directory ]; then
347
+            backup_directory_to_usb $source_directory matrixid
348
+        fi
345
         systemctl start matrix
349
         systemctl start matrix
346
     fi
350
     fi
347
 }
351
 }
373
         rm -rf $temp_restore_dir
377
         rm -rf $temp_restore_dir
374
         chown -R matrix:matrix $MATRIX_DATA_DIR
378
         chown -R matrix:matrix $MATRIX_DATA_DIR
375
 
379
 
380
+        temp_restore_dir=/root/tempmatrixid
381
+        restore_directory_from_usb $temp_restore_dir matrixid
382
+        cp -r $temp_restore_dir/etc/sydent/* /etc/sydent
383
+        if [ ! "$?" = "0" ]; then
384
+            function_check backup_unmount_drive
385
+            backup_unmount_drive
386
+            exit 29562
387
+        fi
388
+        rm -rf $temp_restore_dir
389
+        chown -R matrix:matrix /etc/sydent
390
+
376
         systemctl start matrix
391
         systemctl start matrix
377
     fi
392
     fi
378
 }
393
 }
387
         if [ -d $source_directory ]; then
402
         if [ -d $source_directory ]; then
388
             backup_directory_to_friend $source_directory matrixdata
403
             backup_directory_to_friend $source_directory matrixdata
389
         fi
404
         fi
405
+        source_directory=/etc/sydent
406
+        if [ -d $source_directory ]; then
407
+            backup_directory_to_friend $source_directory matrixid
408
+        fi
390
         systemctl start matrix
409
         systemctl start matrix
391
     fi
410
     fi
392
 }
411
 }
414
         rm -rf $temp_restore_dir
433
         rm -rf $temp_restore_dir
415
         chown -R matrix:matrix $MATRIX_DATA_DIR
434
         chown -R matrix:matrix $MATRIX_DATA_DIR
416
 
435
 
436
+        temp_restore_dir=/root/tempmatrixid
437
+        restore_directory_from_friend $temp_restore_dir matrixid
438
+        cp -r $temp_restore_dir/etc/sydent/* /etc/sydent
439
+        if [ ! "$?" = "0" ]; then
440
+            exit 738356
441
+        fi
442
+        rm -rf $temp_restore_dir
443
+        chown -R matrix:matrix /etc/sydent
444
+
417
         systemctl start matrix
445
         systemctl start matrix
418
     fi
446
     fi
419
 }
447
 }