How to try to start a service only if it isn't running? (Linux)
- by Jader Dias
I know I have to count how many instances are running:
ps x | grep apache2 | wc -l
result if it's running: 2, or else: 1
I also know there is a command called test that I could use to perform the verification, but I don't know how to use test with wc