Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

41 righe
1.2 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. #!/bin/bash
  7. if [ "$(id -u)" != "0" ]; then
  8. echo "This script must be executed as root! Aborting."
  9. exit 1
  10. fi
  11. echo "WARNING! You are about to remove everything the playbook installs for {{ matrix_server_fqn_matrix }}: matrix, docker images, …"
  12. echo -n "If you're sure you want to do this, type: 'Yes, I really want to remove everything!'"
  13. read sure
  14. if [ "$sure" != "Yes, I really want to remove everything!" ]; then
  15. echo "Good thing I asked, exiting"
  16. exit 0
  17. else
  18. echo "Stop and remove Matrix services"
  19. for s in $(find {{ devture_systemd_docker_base_systemd_path }}/ -type f -name "matrix-*" -printf "%f\n"); do
  20. systemctl disable --now $s
  21. rm -f {{ devture_systemd_docker_base_systemd_path }}/$s
  22. done
  23. systemctl daemon-reload
  24. echo "Remove unused Docker images and resources"
  25. docker system prune -af
  26. echo "This playbook creates a lot of matrix-* networks. Consider removing them manually ('docker network ls', followed by 'docker network rm NETWORK_NAME')"
  27. echo "Remove {{ matrix_base_data_path }} directory"
  28. rm -fr "{{ matrix_base_data_path }}"
  29. exit 0
  30. fi