Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

35 řádky
1.0 KiB

  1. #!/bin/bash
  2. if [ "$(id -u)" != "0" ]; then
  3. echo "This script must be executed as root! Aborting."
  4. exit 1
  5. fi
  6. echo "WARNING! You are about to remove everything the playbook installs for matrix.{{ host_specific_hostname_identity }}: matrix, docker images,..."
  7. echo -n "If you're sure you want to do this, type: 'Yes, I really want to remove everything!'"
  8. read sure
  9. if [ "$sure" != "Yes, I really want to remove everything!" ]; then
  10. echo "Good thing I asked, exiting"
  11. exit 0
  12. else
  13. echo "Stop and remove matrix services"
  14. for s in $(find /etc/systemd/system/ -name "matrix-*" -printf "%f\n"); do
  15. systemctl stop $s
  16. rm -f /etc/systemd/system/$s
  17. done
  18. systemctl daemon-reload
  19. echo "Remove matrix cronjobs"
  20. find /etc/cron.d/ -name "matrix-*" -delete
  21. echo "Remove matrix scripts"
  22. find /usr/local/bin/ -name "matrix-*" -delete
  23. echo "Remove every docker images"
  24. docker rmi $(docker images -aq)
  25. echo "Remove docker matrix network"
  26. docker network rm matrix
  27. echo "Remove /matrix directory"
  28. rm -fr /matrix
  29. exit 0
  30. fi