A bash script to test a service established or not.

Need help with C, C++, perl, python, etc?

A bash script to test a service established or not.

Postby hack3rcon » 2020-03-22 20:04

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.
hack3rcon
 
Posts: 343
Joined: 2015-02-16 09:54

Re: A bash script to test a service established or not.

Postby arzgi » 2020-03-23 13:58

Code: Select all
#!/bin/bash

[start Apache] && [next]




&& operator starts the second only if the first was succesfull
arzgi
 
Posts: 568
Joined: 2008-02-21 17:03
Location: Finland


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable