Sfoglia il codice sorgente

Check if sydent was installed

Bob Mottram 8 anni fa
parent
commit
3c58c76dca
1 ha cambiato i file con 15 aggiunte e 9 eliminazioni
  1. 15
    9
      src/freedombone-app-matrix

+ 15
- 9
src/freedombone-app-matrix Vedi File

170
     systemctl restart nginx
170
     systemctl restart nginx
171
     systemctl restart turn
171
     systemctl restart turn
172
     systemctl restart matrix
172
     systemctl restart matrix
173
-    systemctl restart sydent
173
+    if [ -f /etc/systemd/system/sydent.service ]; then
174
+        systemctl restart sydent
175
+    fi
174
 
176
 
175
     # wait for nginx to start otherwise user add fails later
177
     # wait for nginx to start otherwise user add fails later
176
     sleep 5
178
     sleep 5
482
     firewall_remove ${MATRIX_HTTP_PORT}
484
     firewall_remove ${MATRIX_HTTP_PORT}
483
 
485
 
484
     systemctl stop matrix
486
     systemctl stop matrix
485
-    systemctl stop sydent
487
+    if [ -f /etc/systemd/system/sydent.service ]; then
488
+        systemctl stop sydent
489
+    fi
486
 
490
 
487
     function_check remove_turn
491
     function_check remove_turn
488
     remove_turn
492
     remove_turn
489
 
493
 
490
     systemctl disable matrix
494
     systemctl disable matrix
491
-    systemctl disable sydent
492
-    if [ -f /etc/systemd/system/matrix.service ]; then
493
-        rm /etc/systemd/system/matrix.service
494
-    fi
495
     if [ -f /etc/systemd/system/sydent.service ]; then
495
     if [ -f /etc/systemd/system/sydent.service ]; then
496
+        systemctl disable sydent
496
         rm /etc/systemd/system/sydent.service
497
         rm /etc/systemd/system/sydent.service
497
     fi
498
     fi
499
+    if [ -f /etc/systemd/system/matrix.service ]; then
500
+        rm /etc/systemd/system/matrix.service
501
+    fi
498
     apt-get -y remove --purge coturn
502
     apt-get -y remove --purge coturn
499
     cd /etc/matrix
503
     cd /etc/matrix
500
     pip uninstall .
504
     pip uninstall .
501
-    cd /etc/sydent
502
-    pip uninstall .
505
+    if [ -d /etc/sydent ]; then
506
+        cd /etc/sydent
507
+        pip uninstall .
508
+        rm -rf /etc/sydent
509
+    fi
503
     rm -rf $MATRIX_DATA_DIR
510
     rm -rf $MATRIX_DATA_DIR
504
     rm -rf /etc/matrix
511
     rm -rf /etc/matrix
505
-    rm -rf /etc/sydent
506
     deluser matrix
512
     deluser matrix
507
     delgroup matrix
513
     delgroup matrix
508
     remove_onion_service matrix ${MATRIX_ONION_PORT}
514
     remove_onion_service matrix ${MATRIX_ONION_PORT}