For a small helper script that asks what to do, writing the menu, the number check and the loop by hand is boring. Bash has a builtin that does all of it.
select prints the list with numbers, reads a choice and puts the chosen word in your variable:
PS3='Pick an action: '
select action in start stop status quit; do
case $action in
start|stop|status) systemctl "$action" nginx ;;
quit) break ;;
*) echo "invalid choice: $REPLY" ;;
esac
done
It shows 1) start, 2) stop and so on, then the prompt from PS3. After the user types 2, $action holds stop and $REPLY holds the raw input, which helps in that error message.
It keeps asking until something calls break, so always give the user a way out. Ctrl-D on the prompt also ends it.
The menu goes to stderr, not stdout, so redirecting the script’s output to a file does not hide it. I think it fits small admin helpers well; for anything with more than one choice at a time, or when the script must also run unattended, plain arguments with getopts are the better choice.
Further reading: Bash manual: Conditional Constructs (select)