hack3rcon wrote:Hello,
I want to write a bash script to restart a service and if the service launched successfully and established then execute the next command.
For example, restart the Apache service and when the service established then the next command execute.
Thank you.
You might also want to tell us what you actually want, instead of how you think the solution should look like.
If you need a service to depend on another (apache), then systemd already has the means to implement that.
Perhaps your "next command" (or service) does not even need to be started after apache, even if you think it should be like that.