Archive for the Category »DEBIAN «

OScam Auto update script for Debian – Thanks to raja for this script

#!/bin/sh

 ####################################################################
 # 1 June 2011
 # By: Raja
 # Description: Automaticaly Stop Oscam and update to latest oscam version
 # Also restart it after update
 ####################################################################
### Checking if Oscam is running, if yes then Stopping it ##########

process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
 if [ -z "$process" ]; then
 echo "Oscam was not running"
 else
 echo "Stopping Oscam"
 /etc/init.d/oscam stop
 echo "Oscam stopped"
 fi

## Opening Oscam directory #####
 cd /usr/src

## Removing Old directory ######
 rm -rf oscam

### Downloading latest Version in oscam directory #######
 echo "downloading latest SVN release of oscam"
 svn checkout http://streamboard.de.vu/svn/oscam/trunk oscam
 sleep 2

## Opening new oscam directory #######
 cd oscam/

## Making new directory called build ###
 mkdir build

## Opening directory Build
 cd build/

## Compiling Oscam #####
 echo "Starting compilation of oscam with WEBIF Support,CW double check and i***** guessing"
 cmake -DWEBIF=1 I*****_GUESSING=1 -DCS_WITH_DOUBLECHECK=1 ..
 sleep 5
 echo "Compilation finished"

## Installing new version oscam #####
 echo "Now installing"
 make install
 echo "Finished installing"
 sleep 2

## Starting Oscam ######
 /etc/init.d/oscam start
 sleep 2

## Checking if successfully started ####
 echo "Please wait while I check if Oscam started"
 sleep 3
 process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
 if [ -z "$process" ]; then
 echo "Oscam still not running"
 echo "Trying again"
 /etc/init.d/oscam start
 else
 echo "Oscam Running OK"
 fi