Commit 9a006f3a by Francisco Giordano

add check to see if process is running

because when we interrupt the tests via ^C, the signal also kills the
background process
parent 60bc6a6d
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
trap cleanup EXIT trap cleanup EXIT
cleanup() { cleanup() {
# Kill the testrpc instance that we started (if we started one). # Kill the testrpc instance that we started (if we started one and if it's still running).
if [ -n "$testrpc_pid" ]; then if [ -n "$testrpc_pid" ] && ps -p $testrpc_pid > /dev/null; then
kill -9 $testrpc_pid kill -9 $testrpc_pid
fi fi
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment