Bob Mottram 8 years ago
parent
commit
3dc0d7f860
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      src/freedombone-app-matrix

+ 9
- 9
src/freedombone-app-matrix View File

154
 
154
 
155
     pip install --upgrade --process-dependency-links .
155
     pip install --upgrade --process-dependency-links .
156
     chown -R matrix:matrix /etc/matrix
156
     chown -R matrix:matrix /etc/matrix
157
-    chown -R matrix:matrix /var/lib/matrix
157
+    chown -R matrix:matrix $MATRIX_DATA_DIR
158
 }
158
 }
159
 
159
 
160
 function backup_local_matrix {
160
 function backup_local_matrix {
163
         systemctl stop matrix
163
         systemctl stop matrix
164
         function_check backup_directory_to_usb
164
         function_check backup_directory_to_usb
165
         backup_directory_to_usb $source_directory matrix
165
         backup_directory_to_usb $source_directory matrix
166
-        source_directory=/var/lib/matrix
166
+        source_directory=$MATRIX_DATA_DIR
167
         if [ -d $source_directory ]; then
167
         if [ -d $source_directory ]; then
168
             backup_directory_to_usb $source_directory matrixdata
168
             backup_directory_to_usb $source_directory matrixdata
169
         fi
169
         fi
189
 
189
 
190
         temp_restore_dir=/root/tempmatrixdata
190
         temp_restore_dir=/root/tempmatrixdata
191
         restore_directory_from_usb $temp_restore_dir matrixdata
191
         restore_directory_from_usb $temp_restore_dir matrixdata
192
-        cp -r $temp_restore_dir/var/lib/matrix/* /var/lib/matrix
192
+        cp -r $temp_restore_dir$MATRIX_DATA_DIR/* $MATRIX_DATA_DIR
193
         if [ ! "$?" = "0" ]; then
193
         if [ ! "$?" = "0" ]; then
194
             function_check backup_unmount_drive
194
             function_check backup_unmount_drive
195
             backup_unmount_drive
195
             backup_unmount_drive
196
             exit 78352
196
             exit 78352
197
         fi
197
         fi
198
         rm -rf $temp_restore_dir
198
         rm -rf $temp_restore_dir
199
-        chown -R matrix:matrix /var/lib/matrix
199
+        chown -R matrix:matrix $MATRIX_DATA_DIR
200
 
200
 
201
         systemctl start matrix
201
         systemctl start matrix
202
     fi
202
     fi
208
         systemctl stop matrix
208
         systemctl stop matrix
209
         function_check backup_directory_to_friend
209
         function_check backup_directory_to_friend
210
         backup_directory_to_friend $source_directory matrix
210
         backup_directory_to_friend $source_directory matrix
211
-        source_directory=/var/lib/matrix
211
+        source_directory=$MATRIX_DATA_DIR
212
         if [ -d $source_directory ]; then
212
         if [ -d $source_directory ]; then
213
             backup_directory_to_friend $source_directory matrixdata
213
             backup_directory_to_friend $source_directory matrixdata
214
         fi
214
         fi
232
 
232
 
233
         temp_restore_dir=/root/tempmatrixdata
233
         temp_restore_dir=/root/tempmatrixdata
234
         restore_directory_from_friend $temp_restore_dir matrixdata
234
         restore_directory_from_friend $temp_restore_dir matrixdata
235
-        cp -r $temp_restore_dir/var/lib/matrix/* /var/lib/matrix
235
+        cp -r $temp_restore_dir$MATRIX_DATA_DIR/* $MATRIX_DATA_DIR
236
         if [ ! "$?" = "0" ]; then
236
         if [ ! "$?" = "0" ]; then
237
             exit 60923
237
             exit 60923
238
         fi
238
         fi
239
         rm -rf $temp_restore_dir
239
         rm -rf $temp_restore_dir
240
-        chown -R matrix:matrix /var/lib/matrix
240
+        chown -R matrix:matrix $MATRIX_DATA_DIR
241
 
241
 
242
         systemctl start matrix
242
         systemctl start matrix
243
     fi
243
     fi
331
     fi
331
     fi
332
 
332
 
333
     groupadd matrix
333
     groupadd matrix
334
-    useradd -c "Matrix system account" -d /var/lib/matrix -m -r -g matrix matrix
334
+    useradd -c "Matrix system account" -d $MATRIX_DATA_DIR -m -r -g matrix matrix
335
 
335
 
336
     chown -R matrix:matrix /etc/matrix
336
     chown -R matrix:matrix /etc/matrix
337
-    chown -R matrix:matrix /var/lib/matrix
337
+    chown -R matrix:matrix $MATRIX_DATA_DIR
338
 
338
 
339
     echo '[Unit]' > /etc/systemd/system/matrix.service
339
     echo '[Unit]' > /etc/systemd/system/matrix.service
340
     echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service
340
     echo 'Description=Matrix federated messaging' >> /etc/systemd/system/matrix.service