From a0972bab26901703b8e60fb31008c86dd024a91b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 Dec 2016 15:57:36 +0000 Subject: [PATCH] Backup and restore matrix identity server --- src/freedombone-app-matrix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix index 4ccf0a14..185c9ae4 100755 --- a/src/freedombone-app-matrix +++ b/src/freedombone-app-matrix @@ -342,6 +342,10 @@ function backup_local_matrix { if [ -d $source_directory ]; then backup_directory_to_usb $source_directory matrixdata fi + source_directory=/etc/sydent + if [ -d $source_directory ]; then + backup_directory_to_usb $source_directory matrixid + fi systemctl start matrix fi } @@ -373,6 +377,17 @@ function restore_local_matrix { rm -rf $temp_restore_dir chown -R matrix:matrix $MATRIX_DATA_DIR + temp_restore_dir=/root/tempmatrixid + restore_directory_from_usb $temp_restore_dir matrixid + cp -r $temp_restore_dir/etc/sydent/* /etc/sydent + if [ ! "$?" = "0" ]; then + function_check backup_unmount_drive + backup_unmount_drive + exit 29562 + fi + rm -rf $temp_restore_dir + chown -R matrix:matrix /etc/sydent + systemctl start matrix fi } @@ -387,6 +402,10 @@ function backup_remote_matrix { if [ -d $source_directory ]; then backup_directory_to_friend $source_directory matrixdata fi + source_directory=/etc/sydent + if [ -d $source_directory ]; then + backup_directory_to_friend $source_directory matrixid + fi systemctl start matrix fi } @@ -414,6 +433,15 @@ function restore_remote_matrix { rm -rf $temp_restore_dir chown -R matrix:matrix $MATRIX_DATA_DIR + temp_restore_dir=/root/tempmatrixid + restore_directory_from_friend $temp_restore_dir matrixid + cp -r $temp_restore_dir/etc/sydent/* /etc/sydent + if [ ! "$?" = "0" ]; then + exit 738356 + fi + rm -rf $temp_restore_dir + chown -R matrix:matrix /etc/sydent + systemctl start matrix fi }