Changed grep flags (#3706)

If the first grep is already quiet, the second one will not find anything and exit with error code 1. So the quiet flag has to be on the second grep command to get the script working.
This commit is contained in:
Chessmasterrr 2017-06-26 22:31:51 +02:00 committed by Misty Stanley-Jones
parent 464b983761
commit 914f3b4ac6
1 changed files with 2 additions and 2 deletions

View File

@ -59,9 +59,9 @@ this in a few different ways.
# Otherwise it will loop forever, waking up every 60 seconds
while /bin/true; do
ps aux |grep -q my_first_process |grep -v grep
ps aux |grep my_first_process |grep -q -v grep
PROCESS_1_STATUS=$?
ps aux |grep -q my_second_process |grep -v grep
ps aux |grep my_second_process |grep -q -v grep
PROCESS_2_STATUS=$?
# If the greps above find anything, they will exit with 0 status
# If they are not both 0, then something is wrong