i need to exit from shell script when TESTEXCHANGE process is not running on a host.How can i handle this:
I have a script processcheck which checks if the process is running.
I call that to the MainTest script.I want to exit MainTest script if the ProcessCheck script fails.
while read proc; do if (( 0 == $(ps -ef | grep -v grep | grep -c /location) )); then echo "!!!!! $proc down on Master TU !!!!!" RC=1 else echo "!!!!!! $proc is still running on Master TU!!!!!" fi #echo "Not checked" done < /tmp/PROCESSLIST
#!/bin/bash cd /app/utp/bin ssh Test@TestHost 'bash -s' < /ProcessCheck
i want to exit here if processcheck fails next steps