#!/bin/sh
. /var/config/emu.conf
. /var/config/symlink

ems=${emu:0:4}
echo $emu
echo ""
if [ $ems = incu ] && [ -s /tmp/incubusCamd.log ] ; then

ecm1=`tail -n 40 /tmp/incubusCamd.log | grep -A 9 "ECM"| tail -n 9`

echo "$ecm1"
cat /tmp/ecm.info
#&&  [ ! -s /tmp/debug.txt ] && [ ! -s /tmp/pid.info ] ;

elif [ $ems = mbox ] && [ -s /tmp/debug.txt ] ; then
     ecm1=`tail -n 40 /tmp/debug.txt | grep  -A 4 "CW FOR ME" | tail -n 5`
     cid=`echo "$ecm1"|grep CaID`
echo "$ecm1"
  excm=`cat /tmp/pid.info |grep ECM |awk ' {print  $4, $5, $8, $9}'`
    echo ""
    
   echo "$excm"
   echo ""
             
elif [ -s /tmp/ecm.info ] ; then

cat /tmp/ecm.info
  else
                   echo "Information unavailable !!!"
                   echo ""
 
fi
echo ""
