from here

Update apt-get software list
To make sure, you locally have a good software list available, you have to update the apt-get database
Code:

apt-get update

Installing

Now it’s time to get it ready for CCcam.
First thing we need to do is make 6 directory’s and adjust the parameters.
Code:

mkdir /emu
mkdir /emu/cccam
mkdir /emu/script
mkdir /emu/log
mkdir/var/etc
mkdir /var/keys
chmod 777 /emu
chmod 777 /emu/*
chown <username> /emu
chown <username> /emu/*

The username started above is the username you created during the installation. This name is going to be used for file transfer.
Startup script for CCcam
To prevent from having to change directory all the time we’re gonna place a script on the server so CCcam can be started from any directory on the server.
Quote:
vim /emu/script/cccamCode:
#!/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

Code:

chmod 755 /emu/script/cccam
ln /emu/script/cccam /bin/cccam

Now you can simply start, stop or restart CCcam from any directory by simply typing
Code:
cccam start
cccam stop
cccam restartUpload CCcam
Now use a FTP program to upload CCcam.x86 and CCcam.cfg to /emu/cccam
Making CCcam executable
Use putty again to give CCcam.x86 execution rights
Code:
chmod 755 /emu/cccam/CCcam.x86Config update script
When you’re running a big server, restoring connections can take some time then you change you’re config file. I like to do my config changes once a day. I use this script to backup the old config and put the new config in place. This is done at 3am so my peers don’t notice it and they don’t suffer from a freezing picture every time you make a change.
Code:
vim /emu/script/configupdate.shCode:
#!/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
exitCode:
chmod 755 /emu/script/configupdate.shPutting configupdate in crontab
To make sure the config update script will run at 3 am everynight, we can place it in the crontab.
Code:
Code:

cd /etc

vim crontaband add the following line to it
Code:

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

1

This will run the script every day at 3am, and it’s output will be writen in /emu/log/configupdate.log so you can check on occasion if all went well.
Putting CCcam in bootsequence
There’s only one more thing to do. Add CCcam to the startup so it will start on the next reboot.
Code:

vim /etc/rc.local

and add the following line at the bottom
Code:

/bin/cccam start

&test the config update script created earlier to see if that works

Code:
HTML Code:

/emu/script/./configupdate.sh

If it works, you can reboot the server and

check if CCcam is running.
Good luck

Many thx to the guys ar DB tuts and guides

Advertisements