Case

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

Revision #2
Created 4 December 2021 16:15:49 by Janic Voser
Updated 4 December 2021 16:23:26 by Janic Voser