#! /bin/bash
#
# please use for variable EMU
# 1=camd3 | 2=mgcamd | 3=incubusCamd | 4=fortis.sh40 | 5=newcs&mgcamd |  6=oscam&mgcamd
#!/bin/sh


ps -ef|grep camd3 >/tmp/emu.tmp
if [ `grep -ci "/camd3" "/tmp/emu.tmp"` -gt 0 ]; then
  killall -9 camd3
  sleep 1
  if [ `grep -ci "/camd3" "/tmp/emu.tmp"` -gt 0 ]; then
    killall -15 camd3
  fi
fi

ps -ef|grep mgcamd_1.35 >/tmp/emu.tmp
if [ `grep -ci "/mgcamd_1.35" "/tmp/emu.tmp"` -gt 0 ]; then
  killall -9 mgcamd_1.35
  sleep 1
  if [ `grep -ci "/mgcamd_1.35" "/tmp/emu.tmp"` -gt 0 ]; then
    killall -15 mgcamd_1.35
  fi
fi

ps -ef|grep mgcamd_1.33 >/tmp/emu.tmp
if [ `grep -ci "/mgcamd_1.33" "/tmp/emu.tmp"` -gt 0 ]; then
  killall -9 mgcamd
  sleep 1
  if [ `grep -ci "/mgcamd_1.33" "/tmp/emu.tmp"` -gt 0 ]; then
    killall -15 mgcamd_1.33
  fi
fi

ps -ef|grep fortis.sh40 >/tmp/emu.tmp
if [ `grep -ci "/fortis.sh40" "/tmp/emu.tmp"` -gt 0 ]; then
    killall -9 fortis.sh40
  sleep 1
  if [ `grep -ci "/fortis.sh40" "/tmp/emu.tmp"` -gt 0 ]; then
    killall -15 fortis.sh40
  fi
fi
