Matrix server automated install
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. set -euo pipefail
  3. printf 'WARNING: Will remove everything now. Please confirm: (Y/N) '
  4. read answer
  5. if [ "${answer}" != "${answer#[Yy]}" ] ;then
  6. echo "Stopping services"
  7. systemctl disable --now matrix
  8. systemctl disable --now nginx
  9. systemctl disable --now coturn
  10. echo "Purging containers data"
  11. docker system prune -a -f
  12. echo "Removing packages"
  13. apt remove -y --purge pwgen nginx python3-certbot-nginx coturn* docker*
  14. systemctl daemon-reload
  15. echo "Purging files and directories"
  16. rm -rf \
  17. /etc/nginx \
  18. /etc/turn* \
  19. /etc/default/coturn \
  20. /etc/systemd/system/matrix.service \
  21. /opt/matrix \
  22. /tmp/matrix \
  23. /tmp/homeserver.yaml \
  24. /etc/letsencrypt \
  25. /tmp/*.zip
  26. echo "Uninstalling and disabling firewall rules"
  27. ufw disable
  28. apt remove -y --purge ufw
  29. # Removing User's crontab
  30. crontab -r
  31. echo "Purging finished"
  32. else
  33. echo "KillAll aborted"
  34. fi