12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/bash
- #Read service name you want to uninstall
- echo "Please input the service you want to uninstall"
- read conf
- served="/etc/supervisord.d"
- if [ ! -f "$served/$conf" ]
- then
- echo "The service is not existing"
- exit 1
- fi
- echo "Are you sure uninstall ${conf}? y/n"
- read flag
- #Make sure the input is y or n
- until [ "y" == ${flag} ] || [ "n" == ${flag} ]
- do
- echo "Please input y/n again"
- read flag
- done
- case $flag in
- "y")
- rm -rf $served/$conf
- echo "The service has uninstalled"
- ;;
- "n")
- echo "Exit"
- exit 0
- ;;
- *)
- echo "Error,exit uninstall"
- ;;
- esac
|