Suppose you have more than 1 oscam in yr server.
Suppose You have 4 oscams nemed as bin oscam1 ... oscam4
And you want to check them all in one script
#!/bin/bash
for (( i = 1 ; i <= 4 ; i++ ))
do
process=`ps auxwww | grep oscam$i | grep -v grep | awk '{print $1}'`
if [ -z '$process' ]; then
echo && date >> /etc/emu/log/ccam$i_restarts.log
echo "Couldn't find oscam$i running. Restarting server-binary" >> /etc/emu/log/ccam$i_restarts.log
sleep 2
/etc/emu/script/oscam$i stop
sleep 2
/etc/emu/script/oscam$i start
else echo `date "+%y/%m/%d %R Oscam$i is still OK!"`
fi
done
Script will do a loop till checks all oscams
If finds one stopped starts it othewise write log oscamx ok