I'm writing a script to automatically install a bind server on a CentOs 7 distribution.
I'm stuck with systemctl status
, because it does not produce an error code (it's right, since a status is not an error) I can use.
What I want is to check whether the service is started (active). What is the best and efficient way to do this?