Skip to content
Snippets Groups Projects
Commit a0972bab authored by Bob Mottram's avatar Bob Mottram
Browse files

Backup and restore matrix identity server

parent 347a1728
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment