Skip to main content

Case

read -p "systemctl <your input> nginx" systemctl_cmd
case "$systemctl_cmd" in
        start)
            systemctl start nginx ;;
        stop)
            systemctl stop nginx ;;
        restart)
            systemctl restart nginx ;;
        *)
            echo "Your input was not vaild "
esac