Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

42 行
1.3 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. echo "Stop and remove devture services"
  20. for s in $(find {{ devture_systemd_docker_base_systemd_path }}/ -type f -name "devture-*" -printf "%f\n"); do
  21. systemctl disable --now $s
  22. rm -f {{ devture_systemd_docker_base_systemd_path }}/$s
  23. done
  24. systemctl daemon-reload
  25. echo "Remove unused Docker images and resources"
  26. docker system prune -af
  27. echo "Remove Docker matrix network (should be gone already, but ..)"
  28. docker network rm {{ matrix_docker_network }}
  29. echo "Remove {{ matrix_base_data_path }} directory"
  30. rm -fr "{{ matrix_base_data_path }}"
  31. exit 0
  32. fi