Author Topic: Script for checking/restart CCcam status  (Read 1216 times)

0 Members and 1 Guest are viewing this topic.

Offline labud

  • Administrator
  • Hero Member
  • *****
  • Posts: 9026
Script for checking/restart CCcam status
« on: May 11, 2010, 12:12:03 AM »
Script for checking/restart CCcam status
This script will work on most linux dist. including enigma1/2.

The script will check if the CCCam proccess are running with a crontab and restart CCcam if stopped for some reason.

Make a file called checkcccam.sh and place it under /bin. chmod with 755 and paste the green/red text below into the file:


#!/bin/ash
CCCAM_CONFIG_FILE_PATH="/etc"
CCCAM_EXECUTABLE_PATH="/bin"
NAME_OFF_CCCAM_EXECUTABLE="CCcam.x86"
#
ps -eo comm,pid,etime > tmpcat
PID=$(grep -i $NAME_OFF_CCCAM_EXECUTABLE tmpcat | awk -F" " '{ print $2}')
TIME=$(grep -i $NAME_OFF_CCCAM_EXECUTABLE tmpcat | awk -F" " '{ print $3}')
#
if [ "$PID" = "" ]; then
cd $CCCAM_EXECUTABLE_PATH
./$NAME_OFF_CCCAM_EXECUTABLE -C $CCCAM_CONFIG_FILE_PATH/CCcam.cfg
fi
exit 0

Modify the 4 lines marked with red to fit your local settings for paths and name of cccam.
Depending on your Linux dist. the bash location can be on several loacation. In this example it is /bin/sh. Other dist. use /bin/bash, usr/bin/bash, usr/bin/sh or simular.




Make a crontab to run this script every 1 min.:

# crontab -e

Insert the line in red below and save the file: (hit esc followed by :wq! and hit enter to save)
* * * * * /bin/checkcccam.sh


Try to kill your cccam process (killall -9 NAME_OFF_CCCAM_EXECUTABLE) and check that it starts again in max. 1 min.
-----------------------------------------------








UNAUTHORIZED DECODING OF ENCRYPTED SIGNALS FROM EITHER DOMESTIC OR FOREIGN PROVIDERS IS AGAINST THE LAW !!!
INFORMATION CONTAINED IN MY POSTS ["C/P FROM ANOTHER SITE"] ARE FOR LEARNING AND EDUCATIONAL PURPOSES ONLY !!!
PLEASE, DO NOT SEND ME PRIVATE MESSAGES WITH TECHNICAL QUESTIONS, USE FORUM FOR IT !!!