i need to write a bash script to check a service status.
I need to look in the command output; /etc/init.d/ipsec status
The line "1 tunnels up" indicates the service is up.
If the line is not part of the command output i need to restart the service.
Searching in the net there are some examples but searching for service pid, so i can't find an example for this particular case
Any help to do this script?