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

Starting and stopping services

parent a0972bab
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,10 @@ function reconfigure_matrix {
}
function upgrade_matrix {
systemctl stop turn
systemctl stop matrix
systemctl stop sydent
function_check set_repo_commit
set_repo_commit /etc/matrix "matrix commit" "$MATRIX_COMMIT" $MATRIX_REPO
cd /etc/matrix
......@@ -328,14 +332,18 @@ function upgrade_matrix {
chown -R matrix:matrix /etc/sydent
chown -R matrix:matrix $MATRIX_DATA_DIR
systemctl restart turn
systemctl restart matrix
systemctl start turn
systemctl start matrix
systemctl start sydent
}
function backup_local_matrix {
source_directory=/etc/matrix
if [ -d $source_directory ]; then
systemctl stop turn
systemctl stop matrix
systemctl stop sydent
function_check backup_directory_to_usb
backup_directory_to_usb $source_directory matrix
source_directory=$MATRIX_DATA_DIR
......@@ -346,13 +354,18 @@ function backup_local_matrix {
if [ -d $source_directory ]; then
backup_directory_to_usb $source_directory matrixid
fi
systemctl start turn
systemctl start matrix
systemctl start sydent
fi
}
function restore_local_matrix {
if [ -d /etc/matrix ]; then
systemctl stop turn
systemctl stop matrix
systemctl stop sydent
temp_restore_dir=/root/tempmatrix
function_check restore_directory_from_usb
......@@ -388,14 +401,19 @@ function restore_local_matrix {
rm -rf $temp_restore_dir
chown -R matrix:matrix /etc/sydent
systemctl start turn
systemctl start matrix
systemctl start sydent
fi
}
function backup_remote_matrix {
source_directory=/etc/matrix
if [ -d $source_directory ]; then
systemctl stop turn
systemctl stop matrix
systemctl stop sydent
function_check backup_directory_to_friend
backup_directory_to_friend $source_directory matrix
source_directory=$MATRIX_DATA_DIR
......@@ -406,13 +424,18 @@ function backup_remote_matrix {
if [ -d $source_directory ]; then
backup_directory_to_friend $source_directory matrixid
fi
systemctl start turn
systemctl start matrix
systemctl start sydent
fi
}
function restore_remote_matrix {
if [ -d /etc/matrix ]; then
systemctl stop turn
systemctl stop matrix
systemctl stop sydent
temp_restore_dir=/root/tempmatrix
function_check restore_directory_from_friend
......@@ -442,7 +465,9 @@ function restore_remote_matrix {
rm -rf $temp_restore_dir
chown -R matrix:matrix /etc/sydent
systemctl start turn
systemctl start matrix
systemctl start sydent
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