Post

Some more OScam and CCcam monitoring scripts

This script is not tested by me, but apperantly it works just fine!

#!/bin/sh
 #Scriptfile for starting and stopping oscam
 #Scriptwriting done by CC_Share
 #For support and more info visit http://www.eurocardsharing.com
#Setting variables
 CAMNAME="Oscam Server"
 CAMDIR="/emu/oscam"
 CONFDIR="/usr/local/etc"
 LOGDIR="/var/log/oscam/log"
 CAM="oscam.x86"
 # end
# Checking for pid file existance
 if [ ! -f $CAMDIR/oscam.pid ]
 then
 echo "No pidfile exists, Creating PID for oscam"
 else
 rm $CAMDIR/oscam.pid
 echo "Pidfile allready found, Removing old pidfile"
 fi
pidof $CAM > $CAMDIR/oscam.pid
 PID=$(exec cat $CAMDIR/oscam.pid)
# This method starts oscam
 start_cam ()
 {
 $CAMDIR/$CAM -b -c $CONFDIR &
 sleep 5
 }
 # This method stops oscam
 stop_cam ()
 {
 kill -9 $PID
 sleep 5
 }
 case "$1" in
 start)
 echo "[SCRIPT] $1: $CAMNAME"
 ##Check if cam is runing
 if ps | grep -v grep | grep -v start | grep $CAM > /dev/null
 then
 echo "$CAM runing, stop it first!"
 else
 start_cam
 fi
 ;;
 stop)
 echo "[SCRIPT] $1: $CAMNAME"
 stop_cam
 ;;
 restart)
 echo "Restarting $CAMNAME"
 stop_cam
 start_cam
 ;;
 *)
 "$0" stop
 exit 1
 ;;
 esac
 exit 0

NEW SCRIPT NEW SCRIPT NEW SCRIPT NEW SCRIPT NEW SCRIPT

#!/bin/sh
 #Scriptfile for starting and stopping CCcam
 #Script has been modified to enable both x86 and x86_64 versions
 #Scriptwriting done by CC_Share
 #For support and more info visit http://www.eurocardsharing.com
 
 #Setting variables
 CAMNAME="CCcam Server"
 CAMDIR="/emu/cccam"
 LOGDIR="/emu/log"
 # end
 
 # Checking what CCcam version is used on this computer.
 if [ ! -f $CAMDIR/CCcam.x86_64 ]
 then
 CAM="CCcam.x86"
 else
 CAM="CCcam.x86_64"
 fi
 
 # Checking for pid file existance
 if [ ! -f $CAMDIR/cccam.pid ]
 then
 echo "No pidfile exists, Creating PID for CCcam"
 else
 rm $CAMDIR/cccam.pid
 echo "Pidfile allready found, Removing old pidfile"
 fi
 
 pidof $CAM > $CAMDIR/cccam.pid
 PID=$(exec cat $CAMDIR/cccam.pid)
 
 # This method starts CCcam
 start_cam ()
 {
 $CAMDIR/$CAM -dv >> /$LOGDIR/debug.txt &
 sleep 5 
 }
 # This method stops CCcam
 stop_cam ()
 {
 kill -9 $PID
 sleep 5 
 }
 case "$1" in
 start)
 echo "[SCRIPT] $1: $CAMNAME"
 start_cam
 ;;
 stop)
 echo "[SCRIPT] $1: $CAMNAME"
 stop_cam
 ;;
 restart)
 echo "Restarting $CAMNAME"
 stop_cam
 start_cam
 ;;
 *)
 "$0" stop
 exit 1
 ;;
 esac
 exit 0

Leave a comment  

name*

email*

website

Submit comment

CommentLuv badge

Powered by moviekillers.com.com