tidying
This commit is contained in:
parent
bf8a858ff8
commit
3dc0d7f860
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue