Finally got it with your help neutronscott. Thank you for all of your help.
I removed the " & echo $! > cb.pid" from the bottom of the chkscr script and added "ps -aef | grep -v grep | grep '/bin/bash /home/*user*/*serverdir*/exec' | awk '{print $2}' > cb.pid" to the next line.
Now it runs perfectly.
---------- Post updated at 04:38 PM ---------- Previous update was at 03:25 PM ----------
It's not working correctly. Spoke too soon, because my test didn't run long enough. It keeps making chkscr and exec processes. The check in the chkscr script is invalid.
I'm now looking for a check that checks the value in the file cb.pid to the actual PID of the process.
I can get the actual value of the processes PID by using "CBPID=$(ps -aef | grep -v grep | grep '/bin/bash /home/*user*/*serverdir*/exec' | awk '{print $2}')".
I can't find how to extract the PID number stored in the cb.pid file and make a valid "if actual PID = file's PID then end" statement.
Any help would be greatly appreciated.