bash script - check process is running, if not start

view full story

http://www.linuxquestions.org – I am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken. Here is a bash script that I want to run every 10mins via cron: Code: #!/bin/bash if pgrep searchd | grep "[0-9]" then   donothing=0 else   /usr/local/sphinx/bin/searchd fi I cannot get the syntax exactly right, where am I going wrong? Cheers for any help. (HowTos)