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