#!/bin/sh

CAMNAME="OSCam ymod + ee.bin up"
USERNAME=""
ZAPTIME=2
CAMID=1719
DVBSET=0
INFOFILE="ecm.info"
INFOFILELINES=1111111110000000
# end

SRC="http://sat-forum.info/download/index.php?action=downloadfile&filename=ee.bin&directory=oscam_emu_dre2/keys/3c_centr&"
TMP="/tmp/oscam.bin"
DST="/var/tuxbox/config/ee.bin"

remove_tmp () {
  rm -rf /tmp/*.info* /tmp/*.tmp* /tmp/*oscam*
}

case "$1" in
  start)
  echo "[SCRIPT] $1: $CAMNAME"
  remove_tmp
  
# zakachka $SRC v $TMP
wget -q -Y off -O $TMP $SRC
if [ $? = 0 ];then
if [ -f $TMP ];then
# Sravnenie versij
cmp -s $TMP $DST
[ $? = 0 ] || mv $TMP $DST
sync
fi
fi

/var/bin/oscam -b $@
  

  ;;
  stop)
  echo "[SCRIPT] $1: $CAMNAME"
  killall -9 oscam
  remove_tmp
  ;;
  *)
  $0 stop
  exit 0
  ;;
esac

exit 0    







