Aktuelles
Digital Eliteboard - Das Digitale Technik Forum

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

IPC 11.3 Debian

    Nobody is reading this thread right now.
AW: IPC 11.3 Debian

.... ich versteh echt nicht wieso ihr als MODs das immer wieder falsch erklärt bzw so dass eben noch mehr kaputt gehen kann....

Du solltest ein wenig auf dem Boden bleiben und das nicht verallgemeinern!!! Wenn du ein Problem mit einem MOD hast, dann schreib Ihn per PN an und fertig!

Jeder Mensch versucht hier sein Wissen weiterzugeben und wenn mal was falsch ist, ist es auch kein Weltuntergang, dann hilft halt der zweite auf die Sprünge!
 
AW: IPC 11.3 Debian

Jetzt ist es passiert:

CCcam ist eingefroren, aber nicht abgestürzt.

@ RoterBaron: Welches IPC-Forum meinst Du, wo man das Custom CCcam Script finden kann?

Ist eine Telnet-Abfrage für CCcam nicht möglich?

Danke!
 
AW: IPC 11.3 Debian

Welches IPC-Forum meinst Du, wo man das Custom CCcam Script finden kann?
google nach: IPC v11.3

Ist eine Telnet-Abfrage für CCcam nicht möglich?
doch...


hier das script:
Code:
#!/bin/sh
#
# 08.2010
#
## Changelog:
#
# v0.51  added feature to display CCcam's log in realtime...
#        code cleanups...
#
# v0.50  added editor mode for config files (it uses nano if installed else vi)
#        added support for rar -> if installed backuplogs gets packed with -m5
#        readded old and still supported cmds...
#        added /var/log/kern.log (or any other?) to get backuped on crash
#        fixed script-config-checks...
#        fixed connection failed handling of nc...
#        optimized code...
#
# v0.44: added $CCcamLOG as CCcam-output-log filename
#        added another script-config-checks...
#
# v0.43: added BACKUPCARDCHECK to make backups of logfiles on crash
#        removed RESPONDCHECK coz DETECTCHECK does the same (but its still useable)
#
# v0.42: added check for "detected and working cards" 
#        added /tmp/CCcamCheck.lock file so the script cant run twice
#
# v0.41: added '-i 1' to respond/detected checks as NCINTERVAL
#        changed script syntax for cronjob to: check auto
#        added misc stuff like script-config-checks etc...
#
# v0.40: added RESPONDCHECK
#        added ENABLECOLORS
#        fixed start_cam
#
#
## Recommended HowTo:
#
#
# ! ->  ITS VERY IMPORTEND THAT YOU   D O N T   FORWARD ANY OTHER PORTS
# ! ->  EXCEPT CCCAM-SERVER-LISTEN-PORT OUTSIDE YOUR LAN !!
# ! ->  YOU SHOULD ALSO CHANGE   A L L   DEFAULT PORTS !!
#
#
# Add a new shell user and install there your CCcam:
#
#  useradd -m -s/bin/bash CS
#  usermod -G dialout,adm -a CS
#  su - CS
#  mkdir -p CCcam/bin CCcam/logs CCcam/etc
#
# Copy your files as followed: (inc. this script as: cccam)
#
#  CCcam/
#  cccam
#
#  CCcam/etc:
#  CCcam.cfg  CCcam.channelinfo  CCcam.providers  SoftCam.Key  AutoRoll.Key  constant.cw
#
#  CCcam/bin:
#  CCcam.211.x86
#
# Make the CCcam binary and my script executable..
#
#  chmod 700 CCcam/cccam CCcam/bin/CCcam.211.x86
#
# Change the following in your CCcam.cfg:
#
#  TELNETINFO USERNAME : 
#  TELNETINFO PASSWORD : 
#  TELNETINFO LISTEN PORT : 16000
#  SOFTKEY FILE : /home/CS/CCcam/etc/SoftCam.Key
#  AUTOROLL FILE : /home/CS/CCcam/etc/AutoRoll.Key
#  STATIC CW FILE : /home/CS/CCcam/etc/constant.cw
#  CAID PRIO FILE : /home/CS/CCcam/etc/CCcam.prio
#  PROVIDERINFO FILE : /home/CS/CCcam/etc/CCcam.providers
#  CHANNELINFO FILE : /home/CS/CCcam/etc/CCcam.channelinfo
#  LOG WARNINGS : /home/CS/CCcam/logs/warnings.log
#
# Add some cronjob entry so CCcam gets started on reboot and gets checked every 2 minutes:
#
#  echo "@reboot   $HOME/CCcam/cccam start  >/dev/null 2>&1" >> $HOME/.cron
#  echo "*/2 * * * *   $HOME/CCcam/cccam check auto >/dev/null 2>&1" >> $HOME/.cron
#  crontab $HOME/.cron
#
#
# NOTES:
#
#  - i recommend to use */2 !
#    */2 means every 2 minutes (eg.: 12:00, 12:02, 12:04, 12:06, 12:08, 12:10, 12:12...)
#    set it only to * means every minute
#
#  - if you want to run more than one CCcam-server:
#    cp -r CCcam CCcam2 ... rename the binary (eg: CCcam.211.x86_2)
#    reconfigure this script and your new CCcam.cfg
#
#  - COMP is used to choose the compression type to be used, options are: tar or rar
#    rar will produce slightly smaller files but is more processor intensive so
#    may take longer to complete.
#
#
# ...Feel free to change the paths...
# ...which depends on your receiver/image/system...
#
#
### CONFIG - START


# Enable colored output-lines on shell? [yes/no]
ENABLECOLORS="yes"

# Path where the CCcam binary lies, no trailing / [CCcam-default: /var/emu]
CCcamPATH="/home/CS/CCcam/bin"

# Name of the CCcam binary [CCcam-default: cccam]
CCcamBIN="CCcam.211.x86"

# Path to save the CCcam logs to, no trailing / [CCcam-default: /tmp]
CCcamPLOG="/home/CS/CCcam/logs"

# Inside $CCcamPLOG the CCcam-output-log is saved to which file?
CCcamLOG="$CCcamPLOG/log.CCcam"

# Enable above CCcam-output-log? [yes/no]
# NOTE: its growing, and growing...UP in SIZE if you have much peers! but good to debug!
enableLOG="yes"

# Inside $CCcamPLOG we save the crontabed checks to which file?
CCcamCLOG="check.CCcam.log"

# Complete /path/to/file of your CCcam.cfg [CCcam-default: /var/etc/CCcam.cfg]
CCcamCFG="/home/CS/CCcam/etc/CCcam.cfg"

# Options to start CCcam with [CCcam-default: <none>]
# NOTE: DON'T edit unless you know what you are doing!
# NOTE: im using -d to save CCcam's output into a logfile so dont add it again please
CCcamOPTIONS="-t"

# CCCam-IP of your CCcam-Server for respond-checks (normaly: localhost/127.0.0.1)
# NOTE: you need to set this for DETECTCHECK
CCCAMIP="127.0.0.1"

# TELNETINFO-LISTEN-PORT of your CCcam-Server for respond-checks [CCcam-default: 16000]
# NOTE: you need to set this for DETECTCHECK
TELNETPORT="16000"

# Enable "detected and working cards"-check ? [yes/no]
DETECTCHECK="yes"

# For Card-Detected-Check, what is the FIRST word of your card? [Betacrypt/Viaccess/Nds]
# (currently only one identical cardname supported!)
CARDNAME="Betacrypt"

# How many identical cards your using with this CCcam?
CARDNUM="2"

# Create backups from logs of above card-check if it failed ? [yes/no]
BACKUPCARDCHECK="yes"

# Should we backup also another system-log-file for debugging?
# setting this to "" to disable or add more files seperated by space
BACKUPSYSLOGFILELIST="/var/log/kern.log"

# Choose Compression type. (tar or rar)
COMP="tar"


# delay interval for lines sent (for responding check) [default: <empty>]
# NOTE: DON'T edit unless you know what you are doing!
# NOTE: if your CCcam-server runs on an 1xChip dbox its possible that the
# respond-check tooks too long for this script. Than you need to set
# this to '-i 3' or '-i 4'... it waits longer befor quitting and fail...
NCINTERVAL="-i 2"

# default System's binary paths to locate nano and rar, no trailing /
# NOTE: DON'T edit unless you know what you are doing!
SYSTEMbinPATHS="/bin /usr/bin"



### CONFIG - END



# -------------------------------------------------------------- #
# >>> >> >  DO NOT MESS WiTH ANYTHiNG BELOW THiS LiNE!  < << <<< #
# -------------------------------------------------------------- #



DATE=`date`
DOW=`date +%A` # Day of the week e.g. Monday
DNOW=`date +%u` # Day number of the week 1 to 7 where 1 represents Monday
DOM=`date +%d` # Date of the Month e.g. 27
M=`date +%B` # Month e.g January
W=`date +%V` # Week Number e.g 37
VER="0.51"
CHECKFILE="/tmp/cccamtest.log"
tmpCARDNUM="0"


#fixme:
#LogRotate() {
# Weekly Backup
#if [ $DNOW = $DOWEEKLY ]; then
#echo Weekly Backup
#echo
#echo Rotating last weeks Backup...
#if [ "$W" -le 05 ];then
#REMW=`expr 48 + $W`
#elif [ "$W" -lt 15 ];then
#REMW=0`expr $W - 5`
#else
#REMW=`expr $W - 5`
#fi
#eval rm -fv "$REMW.*" 
#}

if [ -z "$ENABLECOLORS" ]; then
   ## Read script-config
   if [ -z $scriptconfig ]; then
      scriptconfig="`dirname $0`/Checkcccam.conf"
   fi
   if [ ! -r $scriptconfig ]; then
      echo "ERROR: Cant read $scriptconfig"
      exit 0
   else
     . $scriptconfig
   fi
fi

if [ -z "$CCcamCFG" ]; then
   CCcamCFG="/var/etc/CCcam.cfg"
fi

if [ "$SYSTEMbinPATHS" = "" ] && [ ! -z "$PATH" ]; then
   SYSTEMbinPATHS=$PATH
fi

if [ "$ENABLECOLORS" = "yes" ]; then
      ROT=`tput setaf 1`
      GRUEN=`tput setaf 2`
      BOLD=`tput bold`
      NORM='tput op && tput sgr0'
   else
      ROT="" ; GRUEN="" ; BOLD="" ; NORM=""
fi

# This methode deletes old and creates an new logfile for CCcam on re/start
create_new_log() {
   if [ ! -e $CCcamLOG ]; then
      touch $CCcamLOG
   else
      mv -f $CCcamLOG ${CCcamLOG}.old
      touch $CCcamLOG
   fi
}

# This method starts CCcam
start_cam() {
     if ps x |grep -v grep |grep -c $CCcamBIN >/dev/null 2>&1
      then
         echo $ROT "ERROR: $CCcamBIN still runs with pid: $(pidof $CCcamBIN)" ; $NORM
      else
         if [ -f "/tmp/.CCcam.nodeid"]; then
            rm -f /tmp/.CCcam.nodeid
         fi
         cd $CCcamPATH
         if [ "$enableLOG" = "yes" ]; then
            create_new_log
            ./$CCcamBIN $CCcamOPTIONS -d -C $CCcamCFG >>$CCcamLOG 2>&1 &
         else
            ./$CCcamBIN $CCcamOPTIONS -q -C $CCcamCFG &
         fi
         echo $GRUEN "Successfully started CCcam with pid: $(pidof $CCcamBIN)" ; $NORM
      fi
}
      
# This method stops CCcam
stop_cam() {
      PiD=$(pidof $CCcamBIN)
      if [ -z "$PiD" ]; then
         echo $ROT "ERROR: Cant see $CCcamBIN to stop..." ; $NORM
      else
         echo $GRUEN "Stopping CCcam with pid: $PiD" ; $NORM
         kill -9 $PiD
      fi
}

# This method checks for running process, detected and working cards and restarts if not...
check_run() {
      if ps x |grep -v grep |grep -c $CCcamBIN >/dev/null
      then
         echo $GRUEN "Seems CCcam still runs with pid: $(pidof $CCcamBIN)" ; $NORM
         if [ "$DETECTCHECK" = "yes" ]; then
               sleep 1 ; check_cards
         fi
      else
         echo "["$DATE"] BAD - Couldn't see $CCcamBIN running. Starting!" >> $CCcamPLOG/$CCcamCLOG
         echo $ROT "Couldn't see $CCcamBIN running. Starting!" ; $NORM
         start_cam
      fi
}

# This method checks detected and working cards and restarts if not...
check_cards() {
      echo "...Checking if all CCcam '$CARDNAME' cards are presend"
      echo entitlements|nc $NCINTERVAL $CCCAMIP $TELNETPORT > $CHECKFILE
      if [ "$?" != "0" ]; then
         echo $ROT "ERROR while connecting to CCcam Server!" ; $NORM
         echo "["$DATE"] BAD - ERROR while connecting to CCcam Server!" >> $CCcamCLOG
         proc_exit
      fi
      CardDetect=$(grep -w $CARDNAME $CHECKFILE)
      tmpCARDNUM=$(grep -c $CARDNAME $CHECKFILE)
      if [ "$tmpCARDNUM" = "$CARDNUM" ]; then
         echo $GRUEN " OK - $tmpCARDNUM Cards are shown in entitlements!"; $NORM
         echo "$CardDetect"
      else
         echo "["$DATE"] BAD - Only $tmpCARDNUM/$CARDNUM Cards detected! Restarting CCcam: $CCcamBIN" >> $CCcamCLOG
         echo $ROT " BAD - Only $tmpCARDNUM/$CARDNUM Cards detected! Restarting CCcam: $CCcamBIN"; $NORM
         if [ "$BACKUPCARDCHECK" = "yes" ]; then
            echo " Creating backup from logs: $CCcamPLOG/$CBFILE"
            echo "["$DATE"] Created backup from logs: $CCcamPLOG/$CBFILE" >> $CCcamCLOG
            $PACKAGER $CHECKFILE $CCcamLOG $BACKUPSYSLOGFILELIST > $CCcamPLOG/$CBFILE
            sleep 1
         fi
         stop_cam
         sleep 10
         start_cam
      fi
      rm -f $CHECKFILE
}

# This method checks if CCcam still responding like it should
check_respond() {
      process=`ps auxwww | grep $CCcamBIN | grep -v grep | awk '{print $1}'`
      if [ -z "$process" ]; then
         echo $ROT " BAD - Couldn't find $CCcamBIN running. Restarting!"; $NORM
         echo "["$DATE"] BAD - Couldn't find $CCcamBIN running. Restarting!" >> $CCcamPLOG/$CCcamCLOG
         start_cam
      else
         echo $GRUEN "CCcam process is present, now checking if CCcam is frozen"; $NORM
         # minimize Logfile size
         LASTLINECHECK=`tail -n1 $CCcamPLOG/$CCcamCLOG | grep "now checking if CCcam is frozen"`
         if [ -z "$LASTLINECHECK" ]; then
            echo "CCcam process is present, now checking if CCcam is frozen" >> $CCcamPLOG/$CCcamCLOG
         fi
         echo info|nc $NCINTERVAL $CCCAMIP $TELNETPORT > $CHECKFILE
         if [ "$?" != "0" ]; then
            echo $ROT "ERROR while connecting to CCcam Server!" ; $NORM
            echo "["$DATE"] BAD - ERROR while connecting to CCcam Server!" >> $CCcamPLOG/$CCcamCLOG
            rm -f $CHECKFILE ; proc_exit
         fi
         CHECKED=$(ls -s $CHECKFILE)
         if [ "$CHECKED" = "0" ]; then
            echo $ROT " BAD - CCcam is frozen, restarting CCcam: $CCcamBIN"; $NORM
            echo "["$DATE"] BAD - CCcam is frozen, restarting CCcam" >> $CCcamPLOG/$CCcamCLOG
            stop_cam
            sleep 10
            start_cam
         else
            echo $GRUEN " OK - CCcam is responding like it should!"; $NORM
            # FixMe: output responding to shell if its NOT triggered: check auto
            if [ ! "$2" = "auto" ]; then
                  echo "CCcam responding:"
                  echo $(cat $CHECKFILE)
            fi
            # minimize Logfile size
            LASTLINECHECK=`tail -n1 $CCcamPLOG/$CCcamCLOG | grep "CCcam is responding like it should"`
            if [ -z "$LASTLINECHECK" ]; then
               echo "["$DATE"] OK - CCcam is responding like it should" >> $CCcamPLOG/$CCcamCLOG
            fi
         fi
         rm -f $CHECKFILE
      fi
}

# This method watches the $CCcamLOG in realtime...
monitor_log() {
      if [ ! -e "$CCcamLOG" ]; then
            echo $ROT "ERROR: Cant find CCcam log $CCcamLOG ... Is it enabled?" ; $NORM
      else
         echo " "
         echo $BOLD "Starting monitoring of $CCcamLOG in realtime. Hit [STRG] + [C] to abort!" ; $NORM
         echo " "
         sleep 1
         tail -f $CCcamLOG
         proc_exit
      fi
}

proc_Get_Packager() {
   unset PACKAGER
   CBFNOW=$(date +"%d.%m.%Y_%H%M")
   for Spath in $SYSTEMbinPATHS ; do
            if [ -x $Spath/rar ]; then
                  PACKAGER="$Spath/rar a -inul -tk -m5 -y"
                  CBFILE="backup_checklog__$CBFNOW.rar"
               fi
   done
   if [ -z "$PACKAGER" ]; then
         PACKAGER="tar -czp"
         CBFILE="backup_checklog__$CBFNOW.tgz"
   fi
}

proc_Get_Editor() {
   unset UseEDITOR
   for Spath in $SYSTEMbinPATHS ; do
      if [ -x "$Spath/nano" ]; then
         UseEDITOR="$Spath/nano -R"
      fi
   done
   if [ -z "$UseEDITOR" ]; then
      for Spath in $SYSTEMbinPATHS ; do
         if [ -x "$Spath/vi" ]; then
            UseEDITOR="$Spath/vi"
         fi
      done
   fi
   if [ -z "$UseEDITOR" ]; then
      echo $ROT "ERROR: Unable to locate Editor to open file - Be sure SYSTEMbinPATHS is set currectly!" ; $NORM
      proc_exit
   fi
}

# edit files given from $1
edit_file() {
   case "$1" in
      conf*)
         EFILE="$CCcamCFG"
         if test -f $EFILE ; then
            echo "Opening file: $EFILE ... with: $UseEDITOR"
            sleep 1 ; $UseEDITOR $EFILE
         else
            echo -e "\033[1;31mError opening file: $EFILE !\033[0m"
         fi
      ;;
      *)
         echo "err... $*"
      ;;
   esac
}


proc_Find_CCcamBIN() {
   CCCAMbinLIST=""
   if [ ! -z "$CCcamPATH" ]; then
         CPfilelist=$(ls $CCcamPATH)
         for Cfile in $CPfilelist ; do
            if [ "$Cfile" = "[cC][cC][cC][aA][mM]*" ]; then
               CCCAMbinLIST="$CCCAMbinLIST $Cfile"
            fi
         done
   fi
}


proc_exit() {
   rm -f "/tmp/CCcamCheck.lock"
   exit 0
}

if [ -e "/tmp/CCcamCheck.lock" ]; then
   if [ "`find \"/tmp/CCcamCheck.lock\" -type f -mmin -5`" ]; then
         echo "Lockfile /tmp/CCcamCheck.lock exists and is not 5 minutes old yet. Quitting!"
         exit 0
   else
         echo "Lockfile exists, but its older then 5 minutes. Removing lockfile."
         touch "/tmp/CCcamCheck.lock"
   fi
else
   touch "/tmp/CCcamCheck.lock"
fi


## script-config checks...
if [ ! -d "$CCcamPLOG" ]; then
   echo $ROT "ERROR: Directory $CCcamPLOG does not exist - Check paths and permissions!" ; $NORM
   proc_exit
fi

if [ ! -w "$CCcamPLOG/$CCcamCLOG" ]; then
   echo $ROT "ERROR: Can not write to $CCcamPLOG/$CCcamCLOG - Check paths and perms!" ; $NORM
   proc_exit
fi

if [ ! -e $CCcamPATH/$CCcamBIN ]; then
   echo $ROT "ERROR: Can not find CCcam binary: $CCcamPATH/$CCcamBIN - Check paths and perms!" ; $NORM
   proc_exit
fi

if [ ! -e $CCcamPLOG/$CCcamCLOG ]; then               
   touch $CCcamPLOG/$CCcamCLOG
fi


# read configs  ((c) SEG74)
proc_Get_CCcamcfg() {
  CCUSER=$(grep -i "WEBINFO USERNAME" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
  CCPASS=$(grep -i "WEBINFO PASSWORD" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
  CCPORT=$(grep -i "WEBINFO LISTEN PORT" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
  CCTPORT=$(grep -i "TELNETINFO LISTEN PORT" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')      
  CCTUSER=$(grep -i "TELNETINFO USERNAME" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
  CCTPASS=$(grep -i "TELNETINFO PASSWORD" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
  #echo "CCUSER: $CCUSER"; echo "CCPASS: $CCPASS"; echo "CCPORT: $CCPORT"
  #echo "CCTUSER: $CCTUSER"; echo "CCTPASS: $CCTPASS"; echo "CCTPORT: $CCTPORT"           
}
proc_Get_CCcamcfg

if [ "$DETECTCHECK" = "yes" -a "$TELNETPORT" != "" -a "$CCTPORT" != "" ]; then
   if [ ! "$TELNETPORT" = "$CCTPORT" ]; then
      echo $ROT "ERROR: Your script-config isnt the same as your CCcam configuration!"
      echo "Your script setting: $TELNETPORT ... But in your CCcam.cfg is TELNETINFO-port: $CCTPORT"; $NORM
      proc_exit
   fi
   proc_Get_Packager
fi


case "$1" in
   start)
      echo "[SCRIPT] $1:"
      start_cam
   ;;
   stop)
      echo "[SCRIPT] $1:"
      stop_cam
   ;;
   restart)
      echo "[SCRIPT] $1:"
      stop_cam
      sleep 10
      start_cam
   ;;
   check)
      echo "[SCRIPT] $1:"
      check_run
   ;;
   card*)
      echo "[SCRIPT] $1:"
      check_cards
   ;;
   respond*)
      echo "[SCRIPT] $1:"
      check_respond
   ;;
   [lL][oO][gG])
      echo "[SCRIPT] $1:"
      monitor_log
   ;;
   conf*)
      echo "[SCRIPT] $1:"
      proc_Get_Editor
      edit_file $1
   ;;
   *)
      echo "Usage: $0 [start|stop|restart|check|cards|respond|log|conf]"
   ;;
esac
proc_exit

allerdings könnte das ein unnötiges sicherheitsrisiko sein wenn Telnet für CCcam an gemacht wird und es sich dabei um keinen homeserver handelt... für solche würde ich eher das abrufen des webifs empfehlen; wenn das nicht mehr reagiert ist cccam ebenfals abgeschmiert...

Code:
#!/bin/bash
#
### CONFIG - START

# /path/to/CCcam.cfg ... if your using USER/PASS ("" to disable and use below settings)
# CCcam-default: /var/etc/CCcam.cfg
CCcamCFG="/var/etc/CCcam.cfg"

# ONLY if you dont run CCcam-Server on same Box (else set above CCcamCFG)
USERNAME=""
PASSWORD=""
WEBINFOPORT=""

# IP/Host of your CCcam-Server to connect to...
CCCAMIP="localhost"

# which command restarts cccam?
RestartCAMcmd="/var/emu/script/cccam restart"

### CONFIG - END

# -------------------------------------------------------------- #
# >>> >> >  DO NOT MESS WiTH ANYTHiNG BELOW THiS LiNE!  < << <<< #
# -------------------------------------------------------------- #


_tmpdirs="/tmp /var/tmp /var/emu/tmp /usr/tmp /usr/local/tmp"
[ ! -z "$HOME" ] && _tmpdirs="${_tmpdirs} $HOME"
for _td in $_tmpdirs; do
    [ -d "$_td" -a -w "$_td" ] && TMPd=$_td && break
done
[ -z "$TMPd" ] && TMPd="" || TMPd=$TMPd/


# read CCcam.cfg and extract user/pass/port
proc_read_CCcamcfg() {
    [ ! -z "$CCcamCFG" -a ! -f "$CCcamCFG" ] && echo "ERROR cant find $CCcamCFG" && exit 1
    USERNAME=`grep -i "WEBINFO USERNAME" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g'`
    PASSWORD=`grep -i "WEBINFO PASSWORD" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g'`
    WEBINFOPORT=`grep -i "WEBINFO LISTEN PORT" $CCcamCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g'`
}

proc_get_infos() {
    [ ! -z "$CCcamCFG" ] && proc_read_CCcamcfg
    [ -z "$WEBINFOPORT" ] && WEBINFOPORT="16001"
    [ -z "$CCCAMIP" ] && CCCAMIP="127.0.0.1"
    if [ -z "$USERNAME" ]; then
        URL="http://${CCCAMIP}:${WEBINFOPORT}"
    else
        URL="http://"${USERNAME}":"${PASSWORD}"@${CCCAMIP}:${WEBINFOPORT}"
    fi
}

proc_get_infos

rm -f ${TMPd}CCcamCheck.html
wget -q -O - "${URL}/" > ${TMPd}CCcamCheck.html
if [ $? -ne "0" ]; then
    echo "Fehler beim anmelden/verbinden aufs CCcam WebIf!"
    exit 1
fi

if [ ! -f "${TMPd}CCcamCheck.html" ]; then
    echo " BAD - CCcam seems frozen, restarting CCcam!"
    $RestartCAMcmd
    if [ $? -ne "0" ]; then
        echo "Fehler beim ausfuehren des CCcam-restart commands!"
        exit 1
    fi
else
    echo "Ok!"
fi


exit 0
 
AW: IPC 11.3 Debian

Blöde Frage, wo kann ich den Text, den Du hier gepostet hast, als Script in meinem Server integrieren?

Ich habe nichts darüber gefunden, weder hier noch bei Google, sorry.

Muss ich bei dem Script (ich verwende nicht das Telnet sondern das, was das Webinterface von CCcam prüft) nochwas anpassen?
 
AW: IPC 11.3 Debian

Muss ich bei dem Script (ich verwende nicht das Telnet sondern das, was das Webinterface von CCcam prüft) nochwas anpassen?
den CONFIG bereich im oberen teil des scripts musst du ggf anpassen...

Blöde Frage, wo kann ich den Text, den Du hier gepostet hast, als Script in meinem Server integrieren?
ein script ist quasi nur eine ausführbare datei in der befehle drin stehen

dh den text den ich oben gepostet habe pakst du einfach in eine datei und machst diese datei ausführbar, also zb:
nano /bin/cres
...text dort rein pasten (text markieren, kopieren und in putty einmal die rechte maustaste drücken zum einfügen)...
...datei ausführbar machen: chmod +x /bin/cres

und danach brauchst du nur noch den befehl cres eingeben und das script wird ausgeführt... und das kannste dir dann auch in die crotab eintragen etc
 
AW: IPC 11.3 Debian

Ich habe jetzt das Script am Laufen, womit geprüft wird, ob das CCcam Webinterface erreichbar ist. Dazu läuft ja noch Cron, was jede Minute prüft ob CCcam läuft...

Aber trotzdem war mein Server 11 Stunden Offline, CCcam lief zwar, aber erst nach einem Restart lief alles wieder.

An welchen Logs kann man ein Fehler erkennen?
 
AW: IPC 11.3 Debian

Was genau hast du laufen?
2 Scripts oder nur eines für CCcam?

Und hast du vllt auch noch die crontab Eintrage für CCcamInfoPHP drin von wegen jede Minute updaten? -> das bringt auch viele zum crashn zumal weil unnötig; wenns dich interessiert kannste auch jüst auf Update klicken.....

ich würd mal spontan in " dmesg " oder /var/log/syslog nachgucken
 
AW: IPC 11.3 Debian

Was genau hast du laufen?
2 Scripts oder nur eines für CCcam?

Ich habe 2 Scripts laufen. Das im Cron, dass jede Minute geprüft wird, ob CCcam noch läuft und das von Dir, was das CCcam Webinterface prüft. Behindern die beiden sich vielleicht gegenseitig? Dann sollte ich wohl den Eintrag im Cron deaktivieren. Wie oft wird eigentlich geprüft, ob das Webinterface der CCcam noch erreichbar ist? (das Script von Dir)

Und hast du vllt auch noch die crontab Eintrage für CCcamInfoPHP drin von wegen jede Minute updaten? -> das bringt auch viele zum crashn zumal weil unnötig; wenns dich interessiert kannste auch jüst auf Update klicken.....

Ja, das habe ich drin. Oki, ich werde es rausnehmen und mal auf Update klicken, wenn es mich interessiert.
 
AW: IPC 11.3 Debian

Das watchdog Script guckt nur ob der Prozess ansich noch da ist, über den Shellbefehl ps aux
Das muss man genauso wie mein Script regelmässig über die crontab ausführen - von alleine rattert es einmal durch und das wars, keine schleife oder so :)

normalerweise wäre es ein und das selbe Script was sich um beides kümmert - stören tun sie sich also eigentlich nicht
 
AW: IPC 11.3 Debian

Es würde mir reichen, wenn dein Script regelmäßig ausgeführt wird.

Wie kann ich für dein Script einen crontab Eintrag erstellen bzw. wie muss der aussehen, dass es jede Minute ausgeführt wird?

Das Script habe ich ja unter nano /bin/cres erstellt, Rechte gesetzt und ausgeführt.
 
AW: IPC 11.3 Debian

feissmaik hat gerade v3 vom cccam-watchdog.sh online gestellt - das beinhaltet beides
-> wget -O/var/emu/script/cccam-watchdog.sh ipc.pebkac.at/ipc/scripts/cccam-watchdog.sh
chmod +x /var/emu/script/cccam-watchdog.sh




Der crontab Eintrag über i jobs sähe genauso aus wie für den watchdog:
Code:
* * * * * root /bin/cres #CCcam - Teste ob CCcam reagiert (jede Minute)
 
AW: IPC 11.3 Debian

Ich kann gar nicht testen, ob das Script funktioniert.

Wenn ich im IPC Webinterface auf CCcam "Stopp" klicke, wird Cron mitgestoppt. Warum?
 
AW: IPC 11.3 Debian

Weil das so warscheinlich eingestellt ist?
Wenn man was umstellt/einstellt und cccam beendet, möchte man für gewöhnlich nicht das es nach einer minute einfach so wieder gestartet wird :)

Stell dazu über ipc cfg den CRON Eintrag auf 0 wenn du nicht willst dass cron mit beendet/gestartet wird
 
AW: IPC 11.3 Debian

CRON Eintrag habe ich auf 0 gesetzt.

Jetzt kann ich CCcam auch alleine stoppen.

Aber wenn ich CCcam stoppe (habe ich eben 3 min gestoppt) wird CCcam nicht neugestartet.

Ich habe nur noch dein Script aktiviert.
 
Zurück
Oben