Debugging bash script to check for running process