Cccam

Allikas: Traadita Wiki by Jan & Co.

Konfigureerimine

sud su
mkdir /emu
mkdir /emu/cccam
mkdir /emu/script
mkdir /emu/log
mkdir /var/etc
mkdir /var/keys
sudo gedit /emu/script/cccam

#!/bin/sh
CAMNAME="CCcam Server"
# end

# This method starts CCcam
start_cam ()
{
/emu/cccam/CCcam.x86 &
sleep 2
}
# This method stops CCcam
stop_cam ()
{
pkill CCcam.x86
}
case "$1" in
start)
echo "[SCRIPT] $1: $CAMNAME"
start_cam
;;
stop)
echo "[SCRIPT] $1: $CAMNAME"
stop_cam
;;
restart)
echo "Restaring $CAMNAME"
stop_cam
start_cam
;;
*)
"$0" stop
exit 1
;;
esac
exit 0

sudo chmod 755 /emu/script/cccam
sudo ln /emu/script/cccam /bin/cccam
wget http://wiki.wifi.ee/dvbt/CCcam-Linux.tar.gz
tar xvzf CCcam-Linux.tar.gz
cd   ~/CCcam-Linux
cp -d ~/CCcam-Linux/etc/CCcam.cfg  /emu/cccam
cp -d ~/CCcam-Linux/emu/CCcam.x86  /emu/cccam
sudo gedit /emu/script/configupdate.sh

#!/bin/sh
#Script to process new config and backup old one.
#Script designed and written by CC_Share
SOURCE=/emu/cccam
TARGET=/var/etc
FILE=CCcam.cfg
BACKUPDIR=/var/backup
CONFIGOLD=CCcam.old
if test -f $SOURCE/$FILE ; then
echo "New Config Present"
if test -d $BACKUPDIR ; then
if test -f $BACKUPDIR/$CONFIGOLD ; then
echo "Removing OLD config file from backup directory"
rm $BACKUPDIR/$CONFIGOLD
else
echo "No OLD config to remove."
fi

if test -f $BACKUPDIR/$FILE ; then
echo "Renaming Backup to old config"
cp $BACKUPDIR/$FILE $BACKUPDIR/$CONFIGOLD
rm $BACKUPDIR/$FILE
else
echo "No Backupfile present yet"
fi
if test -f $TARGET/$FILE ; then
echo "Copying Original config to Backup directory"
cp $TARGET/$FILE $BACKUPDIR
rm $TARGET/$FILE
else
echo "No Original Config File Present!?!?"
fi
else
echo "Backup directory does not exist."
echo "making new directory"
mkdir $BACKUPDIR
if test -f $TARGET/$FILE ; then
echo "Copying Original config to Backup directory"
cp $TARGET/$FILE $BACKUPDIR
else
echo "No Original Config File Present!?!?"
fi
fi
echo "Moving New config file to "$TARGET
cp $SOURCE/$FILE $TARGET
rm $SOURCE/$FILE
else
echo "No New Config present, Nothing to process"
fi
exit

sudo chmod 755 /emu/script/configupdate.sh
cd /etc
sudo gedit crontab

Ava ja kopeeri rida

sudo gedit /etc/rc.local
/bin/cccam start &

Testime konfigu uuenduse skripti.

sudo /emu/script/./configupdate.sh

Käivitamine

Käivitame Cccam-i

cccam start

Peatame CCcam serveri.

cccam stop

Taastkäivitame Ccam serveri.

cccam restart