Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 line
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 {{ matrix_systemd_path }}/ -type f -name "matrix-*" -printf "%f\n"); do
  16. systemctl disable --now $s
  17. rm -f {{ matrix_systemd_path }}/$s
  18. done
  19. systemctl daemon-reload
  20. echo "Remove matrix scripts"
  21. find {{ matrix_local_bin_path }}/ -name "matrix-*" -delete
  22. echo "Remove unused Docker images and resources"
  23. docker system prune -af
  24. echo "Remove Docker matrix network (should be gone already, but ..)"
  25. docker network rm {{ matrix_docker_network }}
  26. echo "Remove {{ matrix_base_data_path }} directory"
  27. rm -fr "{{ matrix_base_data_path }}"
  28. exit 0
  29. fi