uninstall.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. if [ $USER = root ] ; then
  12. echo "You are root";
  13. sudo=""
  14. else
  15. sudo="sudo "
  16. fi
  17. case "$choice" in
  18. y|Y )
  19. # Stop the ArozOS service if it is running
  20. if [[ $(uname) == "Linux" ]]; then
  21. if systemctl status arozos >/dev/null 2>&1; then
  22. ${sudo}systemctl stop arozos
  23. echo "Stopped ArozOS service."
  24. fi
  25. fi
  26. # Remove the ArozOS folder
  27. cd ~/ || exit
  28. if [[ -d "arozos" ]]; then
  29. ${sudo}rm -rf arozos
  30. echo "Removed ArozOS folder."
  31. fi
  32. # Remove the ArozOS service file
  33. if [[ $(uname) == "Linux" ]]; then
  34. if [[ -f "/etc/systemd/system/arozos.service" ]]; then
  35. ${sudo}rm /etc/systemd/system/arozos.service
  36. echo "Removed ArozOS systemd service file."
  37. fi
  38. fi
  39. ${sudo}systemctl daemon-reload
  40. echo "ArozOS has been uninstalled successfully!"
  41. ;;
  42. n|N )
  43. echo "Uninstall cancelled"
  44. ;;
  45. * )
  46. echo "Invalid input, uninstall cancelled"
  47. ;;
  48. esac