Check to see if a process is already running

I have a hazel script set to run an automator action, which is fine.
My automator script feeds a terminal command with variables, works great.
What I am worried about is that I would like hazel to NOT run the automator script if the process is already running. So I assume I would need to check via a shell script, to see if process X is already running. If so, dont run it.
If it is not, then run it. Can someone point me in the right direction for a shell script to see if a process is running?
My automator script feeds a terminal command with variables, works great.
What I am worried about is that I would like hazel to NOT run the automator script if the process is already running. So I assume I would need to check via a shell script, to see if process X is already running. If so, dont run it.
If it is not, then run it. Can someone point me in the right direction for a shell script to see if a process is running?