PDA

View Full Version : How To: Install CCcam on Debian 6



Jaxo
05-03-2011, 08:59
HOW TO INSTALL CCcam x86 ON DEBIAN 6

Install debian 6 on your server with the options below:

*Web server
*SSH server
*Standalone

Next log in via putty SSH and copy paste the following entries:


apt-get update


apt-get install proftpd


mkdir /emu


mkdir /emu/cccam


mkdir /emu/script


mkdir /emu/log


mkdir /var/etc


mkdir /var/keys


chown "user-name" /emu


chown "user-name" /emu/


chown "user-name" /emu/cccam


chown "user-name" /emu/cccam/


chown "user-name" /emu/script


chown "user-name" /emu/script/


chown "user-name" /emu/log


chown "user-name" /emu/log/


chown "user-name" /var/www


chown "user-name" /var/www/


chmod 777 /emu


chmod 777 /emu/


chmod 777 /emu/log


chmod 777 /emu/log/


chmod 777 /emu/log


chmod 777 /emu/log/


chmod 777 /emu/script


chmod 777 /emu/script/


chmod 777 /var/www


chmod 777 /var/www/


nano /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




chmod 755 /emu/script/cccam


ln /emu/script/cccam /bin/cccam

Next put the CCcam.x86 bin file in the emu/cccam (download HERE (http://cccam-exchange.com/viewtopic.php?f=86&t=2596&p=5824#p5824)


chmod 755 /emu/cccam/CCcam.x86


nano /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



chmod 755 /emu/script/configupdate.sh


cd /etc


nano crontab

Next add this line to server, reboot and this will update config file at 6AM.
Change to other time if you want to that happent in other time.


00 6 * * * root /emu/script/./configupdate.sh >>/emu/log/configupdate.log 2>&1

REBOOT


nano /etc/rc.local

Now at this line just above the last line


/bin/cccam start &

Update the config file manualy


/emu/script/./configupdate.sh

Now You can:

cccam start

cccam stop

cccam restart

And Check the CCcam Script

#!/bin/sh
if ps x |grep -v grep |grep -c CCcam >/dev/null
then
echo "cccam... ok"
else
echo "cccam... restarting"
/emu/cccam/CCcam_2.2.1 &
fi


Afterwards...


reboot

load you config and your good to go

thomash1
03-04-2011, 09:04
I apologize in advance for it's English translator.
I would like to ask if the theories "that take two Debain6 Cccam server?
Is there any script instal? Thank you Thomas

Jaxo
03-04-2011, 09:47
Hi, there is no script install for debian 6 yet. There is for debian 5 though... However I do not seeany real advantage of cccam on debian 6 over debian 5 ;)

thomash1
04-04-2011, 08:41
I do not care if either 5 or 6, but I need instal script on two or more cccamu for Debain
Thank you Thomas

craw
13-05-2011, 09:51
I used Jaxo's automated script to install on Debian 6.No problems! :)