123456789101112131415161718192021222324252627282930313233343536 |
- #!/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
- 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
|