Simple bash script to see status and restart a service using if then
Posted on 2013-05-31
I am wondering if someone could post an example of an interactive bash script that prompts the user with a menu with 2 choices:
1. Do you want to see service status
2. Do you want to stop, start, restart service
If 1. show status, if 2 go to another menu. The 2nd menu would give options for either stopping, starting, or restarting the service.
I know there are many ways to do this but I am trying to understand if this can be done using just if / then statements and if you could post the code it would help me understand as I am just starting to learn about bash scripts.