The answer is in your post, you just need to put it all together.
if ( `ps -ef | grep squid | grep -v grep | wc -l` -eq 1 )
echo "not so good"
You could also use the pgrep utility which returns the process id. As shown below.
if (pgrep squid > 0)
echo "squid is running"
echo "squid is dead"
for some reason the code tag doesn't seem to work right now.
Last edited by jdc2048; 01-21-2003 at 08:43 PM.