uninstall.sh 561 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. echo "Please input the service you want to uninstall"
  3. read conf
  4. served="/etc/supervisord.d"
  5. if [ ! -f "$served/$conf" ]
  6. then
  7. echo "The service is not existing"
  8. exit 1
  9. fi
  10. echo "Are you sure uninstall ${conf}? y/n"
  11. read flag
  12. until [ "y" == ${flag} ] || [ "n" == ${flag} ]
  13. do
  14. echo "Please input y/n again"
  15. read flag
  16. done
  17. case $flag in
  18. "y")
  19. rm -rf $served/$conf
  20. echo "The service has uninstalled"
  21. ;;
  22. "n")
  23. echo "Exit"
  24. exit 0
  25. ;;
  26. *)
  27. echo "Error,exit uninstall"
  28. ;;
  29. esac