Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 

35 строки
1.1 KiB

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