What I’m trying to do is to start a process if not started. Here is what I try
#!/bin/bash
pid=`ps ax | grep app | grep -v grep | wc -l`
if [ $pid = 0 ]
then
/etc/init.d/app start
fi
The problem is that the line
/etc/init.d/app start
is not executed. What is wrong here ?
I know that I can you daemontools but I like the “bash” approach.
Take a look at the
==operator.Best may be something like