Преглед на файлове

Starting and stopping services

Bob Mottram преди 8 години
родител
ревизия
75cf4d62d6
променени са 1 файла, в които са добавени 27 реда и са изтрити 2 реда
  1. 27
    2
      src/freedombone-app-matrix

+ 27
- 2
src/freedombone-app-matrix Целия файл

313
 }
313
 }
314
 
314
 
315
 function upgrade_matrix {
315
 function upgrade_matrix {
316
+    systemctl stop turn
317
+    systemctl stop matrix
318
+    systemctl stop sydent
319
+
316
     function_check set_repo_commit
320
     function_check set_repo_commit
317
     set_repo_commit /etc/matrix "matrix commit" "$MATRIX_COMMIT" $MATRIX_REPO
321
     set_repo_commit /etc/matrix "matrix commit" "$MATRIX_COMMIT" $MATRIX_REPO
318
     cd /etc/matrix
322
     cd /etc/matrix
328
     chown -R matrix:matrix /etc/sydent
332
     chown -R matrix:matrix /etc/sydent
329
     chown -R matrix:matrix $MATRIX_DATA_DIR
333
     chown -R matrix:matrix $MATRIX_DATA_DIR
330
 
334
 
331
-    systemctl restart turn
332
-    systemctl restart matrix
335
+    systemctl start turn
336
+    systemctl start matrix
337
+    systemctl start sydent
333
 }
338
 }
334
 
339
 
335
 function backup_local_matrix {
340
 function backup_local_matrix {
336
     source_directory=/etc/matrix
341
     source_directory=/etc/matrix
337
     if [ -d $source_directory ]; then
342
     if [ -d $source_directory ]; then
343
+        systemctl stop turn
338
         systemctl stop matrix
344
         systemctl stop matrix
345
+        systemctl stop sydent
346
+
339
         function_check backup_directory_to_usb
347
         function_check backup_directory_to_usb
340
         backup_directory_to_usb $source_directory matrix
348
         backup_directory_to_usb $source_directory matrix
341
         source_directory=$MATRIX_DATA_DIR
349
         source_directory=$MATRIX_DATA_DIR
346
         if [ -d $source_directory ]; then
354
         if [ -d $source_directory ]; then
347
             backup_directory_to_usb $source_directory matrixid
355
             backup_directory_to_usb $source_directory matrixid
348
         fi
356
         fi
357
+
358
+        systemctl start turn
349
         systemctl start matrix
359
         systemctl start matrix
360
+        systemctl start sydent
350
     fi
361
     fi
351
 }
362
 }
352
 
363
 
353
 function restore_local_matrix {
364
 function restore_local_matrix {
354
     if [ -d /etc/matrix ]; then
365
     if [ -d /etc/matrix ]; then
366
+        systemctl stop turn
355
         systemctl stop matrix
367
         systemctl stop matrix
368
+        systemctl stop sydent
356
 
369
 
357
         temp_restore_dir=/root/tempmatrix
370
         temp_restore_dir=/root/tempmatrix
358
         function_check restore_directory_from_usb
371
         function_check restore_directory_from_usb
388
         rm -rf $temp_restore_dir
401
         rm -rf $temp_restore_dir
389
         chown -R matrix:matrix /etc/sydent
402
         chown -R matrix:matrix /etc/sydent
390
 
403
 
404
+        systemctl start turn
391
         systemctl start matrix
405
         systemctl start matrix
406
+        systemctl start sydent
392
     fi
407
     fi
393
 }
408
 }
394
 
409
 
395
 function backup_remote_matrix {
410
 function backup_remote_matrix {
396
     source_directory=/etc/matrix
411
     source_directory=/etc/matrix
397
     if [ -d $source_directory ]; then
412
     if [ -d $source_directory ]; then
413
+        systemctl stop turn
398
         systemctl stop matrix
414
         systemctl stop matrix
415
+        systemctl stop sydent
416
+
399
         function_check backup_directory_to_friend
417
         function_check backup_directory_to_friend
400
         backup_directory_to_friend $source_directory matrix
418
         backup_directory_to_friend $source_directory matrix
401
         source_directory=$MATRIX_DATA_DIR
419
         source_directory=$MATRIX_DATA_DIR
406
         if [ -d $source_directory ]; then
424
         if [ -d $source_directory ]; then
407
             backup_directory_to_friend $source_directory matrixid
425
             backup_directory_to_friend $source_directory matrixid
408
         fi
426
         fi
427
+
428
+        systemctl start turn
409
         systemctl start matrix
429
         systemctl start matrix
430
+        systemctl start sydent
410
     fi
431
     fi
411
 }
432
 }
412
 
433
 
413
 function restore_remote_matrix {
434
 function restore_remote_matrix {
414
     if [ -d /etc/matrix ]; then
435
     if [ -d /etc/matrix ]; then
436
+        systemctl stop turn
415
         systemctl stop matrix
437
         systemctl stop matrix
438
+        systemctl stop sydent
416
 
439
 
417
         temp_restore_dir=/root/tempmatrix
440
         temp_restore_dir=/root/tempmatrix
418
         function_check restore_directory_from_friend
441
         function_check restore_directory_from_friend
442
         rm -rf $temp_restore_dir
465
         rm -rf $temp_restore_dir
443
         chown -R matrix:matrix /etc/sydent
466
         chown -R matrix:matrix /etc/sydent
444
 
467
 
468
+        systemctl start turn
445
         systemctl start matrix
469
         systemctl start matrix
470
+        systemctl start sydent
446
     fi
471
     fi
447
 }
472
 }
448
 
473