From 3dc0d7f8604a7f571cd1f7c9aba4811fc3f388f8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Dec 2016 18:38:09 +0000 Subject: [PATCH] tidying --- src/freedombone-app-matrix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix index e28920d2..123b6ceb 100755 --- a/src/freedombone-app-matrix +++ b/src/freedombone-app-matrix @@ -154,7 +154,7 @@ function upgrade_matrix { pip install --upgrade --process-dependency-links . chown -R matrix:matrix /etc/matrix - chown -R matrix:matrix /var/lib/matrix + chown -R matrix:matrix $MATRIX_DATA_DIR } function backup_local_matrix { @@ -163,7 +163,7 @@ function backup_local_matrix { systemctl stop matrix function_check backup_directory_to_usb backup_directory_to_usb $source_directory matrix - source_directory=/var/lib/matrix + source_directory=$MATRIX_DATA_DIR if [ -d $source_directory ]; then backup_directory_to_usb $source_directory matrixdata fi @@ -189,14 +189,14 @@ function restore_local_matrix { temp_restore_dir=/root/tempmatrixdata restore_directory_from_usb $temp_restore_dir matrixdata - cp -r $temp_restore_dir/var/lib/matrix/* /var/lib/matrix + cp -r $temp_restore_dir$MATRIX_DATA_DIR/* $MATRIX_DATA_DIR if [ ! "$?" = "0" ]; then function_check backup_unmount_drive backup_unmount_drive exit 78352 fi rm -rf $temp_restore_dir - chown -R matrix:matrix /var/lib/matrix + chown -R matrix:matrix $MATRIX_DATA_DIR systemctl start matrix fi @@ -208,7 +208,7 @@ function backup_remote_matrix { systemctl stop matrix function_check backup_directory_to_friend backup_directory_to_friend $source_directory matrix - source_directory=/var/lib/matrix + source_directory=$MATRIX_DATA_DIR if [ -d $source_directory ]; then backup_directory_to_friend $source_directory matrixdata fi @@ -232,12 +232,12 @@ function restore_remote_matrix { temp_restore_dir=/root/tempmatrixdata restore_directory_from_friend $temp_restore_dir matrixdata - cp -r $temp_restore_dir/var/lib/matrix/* /var/lib/matrix + cp -r $temp_restore_dir$MATRIX_DATA_DIR/* $MATRIX_DATA_DIR if [ ! "$?" = "0" ]; then exit 60923 fi rm -rf $temp_restore_dir - chown -R matrix:matrix /var/lib/matrix + chown -R matrix:matrix $MATRIX_DATA_DIR systemctl start matrix fi @@ -331,10 +331,10 @@ function install_matrix { fi groupadd matrix - useradd -c "Matrix system account" -d /var/lib/matrix -m -r -g matrix matrix + useradd -c "Matrix system account" -d $MATRIX_DATA_DIR -m -r -g matrix matrix chown -R matrix:matrix /etc/matrix - chown -R matrix:matrix /var/lib/matrix + chown -R matrix:matrix $MATRIX_DATA_DIR echo '[Unit]' > /etc/systemd/system/matrix.service echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service