uninstall.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. cat << "EOF"
  3. _ ___ ___ ___ __
  4. /_\ _ _ ___ ___/ _ \/ __| |_ ) / \
  5. / _ \| '_/ _ \_ / (_) \__ \ / / | () |
  6. /_/ \_\_| \___/__|\___/|___/ /___(_)__/
  7. ----- ArozOS 2.0 Uninstall -----
  8. EOF
  9. # Ask user to confirm uninstall
  10. read -p "Are you sure you want to uninstall Arozos? This will delete all data in the arozos directory. (y/n) " choice
  11. case "$choice" in
  12. y|Y )
  13. # Stop the ArozOS service if it is running
  14. if [[ $(uname) == "Linux" ]]; then
  15. if systemctl status arozos >/dev/null 2>&1; then
  16. sudo systemctl stop arozos
  17. echo "Stopped ArozOS service."
  18. fi
  19. fi
  20. # Remove the ArozOS folder
  21. cd ~/ || exit
  22. if [[ -d "arozos" ]]; then
  23. sudo rm -rf arozos
  24. echo "Removed ArozOS folder."
  25. fi
  26. # Remove the ArozOS service file
  27. if [[ $(uname) == "Linux" ]]; then
  28. if [[ -f "/etc/systemd/system/arozos.service" ]]; then
  29. sudo rm /etc/systemd/system/arozos.service
  30. echo "Removed ArozOS systemd service file."
  31. fi
  32. fi
  33. sudo systemctl daemon-reload
  34. echo "ArozOS has been uninstalled successfully!"
  35. ;;
  36. n|N )
  37. echo "Uninstall cancelled"
  38. ;;
  39. * )
  40. echo "Invalid input, uninstall cancelled"
  41. ;;
  42. esac