PDA

View Full Version : Howto MultiProtocolCardServer MPCS + CCcam



me1960
02-02-09, 08:02
Howto MultiProtocolCardServer MPCS + CCcam


'' Howto MPCS + CCcam on debian lenny, based on "Howto: Building Debian Linux server with CCcam" written by CC_share (useful for N3 cards with hd-channels so you should use mbox as newcs client)

This howto ´ll show you the installation for Debian linux with Multi Protocol Card Server or short MPCS. If you use it, you´ll have a very symbiotic cs, which can handle many different cs-protocolls on the same time and if you want, with only one common card-source.
For further informations look into the doc-directory of mpcs.
The MPCS is originally written by Dukat from streamboard.

You should use this description for installation of the os and mpcs in case of a fresh system-install.

To use cccam and mpcs together on a fresh system, you should first install debian-linux codename-lenny, followed by the steps for cccam install by CC_share. (without OS-install offcourse ;)

a) You can also combine this tutorial with "Howto: Building Debian Linux server with CCcam" to use a cccam server and mpcs as cardserver.
or (and)
b) You can also combine this tutorial with "Howto install a NewCS Server on Debian Linux" to use a NewCS and mpcs as cardserver.
In case of point a or - (and) b mixes on existing os you must upgrade your system from debian etch to debian lenny to be able to use the current mpcs binary.
In this case you can copy and paste the following command in your putty terminal
code:

vim /etc/apt/sources.list

Edit your current debian etch paths by changing every "etch" into "lenny".
To do that, you have to push the "i" button on your keyboard to enable the editmode of vim.

Now you must push "i" on your keyboard to edit the values
example before

deb Debian -- Security Information (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fsecurity.debian.org%2F) etch/updates main contrib non-free
deb-src Debian -- Security Information (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fsecurity.debian.org%2F) etch/updates main contrib non-free

deb Index of /debian-volatile (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fvolatile.debian.org%2Fdebian-volatile) etch/volatile main contrib non-free
deb-src Index of /debian-volatile (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fvolatile.debian.org%2Fdebian-volatile) etch/volatile main contrib non-free

example after
code:

deb Debian -- Security Information (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fsecurity.debian.org%2F) lenny/updates main contrib non-free
deb-src Debian -- Security Information (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fsecurity.debian.org%2F) lenny/updates main contrib non-free

deb Index of /debian-volatile (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fvolatile.debian.org%2Fdebian-volatile) lenny/volatile main contrib non-free
deb-src Index of /debian-volatile (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fvolatile.debian.org%2Fdebian-volatile) lenny/volatile main contrib non-free

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

Next commands are
Code:

vim /etc/apt/preferences

Now you must push "i" on your keyboard to edit the values
code:

Package: *
Pin: release a=etch
Pin-Priority: 700

Package: *
Pin: release a=lenny
Pin-Priority: 650


Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

Let´s start now with the installation on a fresh system.

Needed tools are a terminal programm like "putty" and a ftp proggy like "filezilla".
I would also suggest to use VIM, a linuxcompatible editor for windows. If you use this one as standard, from now on you have also a good training for editing files in debian linux. You can select it in the settings menue of "Filezilla" under the tabs "edit","settings","File editing". Choose the option "Always use default editor" and browse to the install path of VIM, select the gvim.exe and write the attribute -y into the default editor window after "C:\your\path\to\gvim.exe -y". Save it by pressing "OK" and now your standard appz for editing files in filezilla is VIM.
You can download the actual MPCS here "Streamboard | Ihnen wird der Zutritt zu dieser Seite verwehrt. (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fstreamboard.gmc.to%2Fwbb2%2Fattachment.php%3Fattachmentid%3D11112)" after registration. I would give you a link from eurocardsharing, but i did´nt find it here.
If this link is deleted by admins use "Download mpcs-0.9e-community-i386-pc-debian-lenny-23012009.tar.gz, upload your files and earn money. (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fwww.easy-share.com%2F1903470855%2Fmpcs-0.9e-community-i386-pc-debian-lenny-23012009.tar.gz)" or use google and enter mpcs 0.9e or mpcs-pre_09e.
May be they will create now a mpcs-section, or may be, it´s hidden. ;)

The OS-install is, if still needed, very easy.
Just choose and download a debian-lenny iso matching to your architecture from Debian -- Debian-Installer (http://www.eurocardsharing.com/redirect-to/?redirect=http%3A%2F%2Fwww.us.debian.org%2Fdevel%2Fdebian-installer%2F) (i use the i386 netinstall version), burn it to a cd with burning software like nero or imageburn and start your installation on a fresh pc.
Choose the expert install option, choose your language, country, keyboardsettings and press enter by the next options until you come to the point with installercomponents to choose, select openssh-client-udeb and network-console.
Go on by pressing enter and go to the point with network-installation, choose, if not automatically recognized, your network hardware and press enter again. Now you´ll be asked for the network configuration way, where you choose the manual option.
Here you can give the ip-adress for your new system. This should be differ only in the last 3 digits from your existing network stations.
For example your windows pc has 192.168.178.3, then this ip can be 192.168.178.4 .
After pressing enter you can leave the next value like it is, because depending on your ip-adress the system has auto-recognized the right value for netmask here.
The next steps are gateway and DNS-server, also auto-recognized, so you can go on by pressing enter again.
Finally you can check your network-parameters and if everything looks fine, select yes and go on.
You can choose a computer and domainname now and go on with installation over network (SSH) by the next option.
After selecting this point your machine generates a ssh-cryptkey and asked you to enter your remote-install password.
Choose it, confirm it and after pressing enter follow the hints on screen.
From now on you can access your server remotely wih putty. After login choose expert-install again and you can configure clocksettings and timezone (i suggest to leave it on system defaults).
The next point is disk detection so select it and go on with disks partitioning.
Choose "Guided partitioning" then select "Guided - use entire disk", select your hd-model and choose "Separate /home, /usr, and /tmp partitions".
Then select "Finish partitioning and write changes to disk" and confirm it with "yes" in the next window.
Then go on with "Install the base system" and wait until it´s done.
Now you can select the kernel to install. It´s okay to select the system default option.
The next step is to configure udev where i choose the "generic: include all available drivers" option.
After it´s done, setup your users and passwords with shadow passwords and root login enabled.
Now configure the package manager and answer "use a network manager" with yes. http is here ok. Select your country for debian archive mirror
and select one of them.
If you use a proxy, then you can enter this in the next window or, if not, leave this field blank. In the next window choose "yes" to be able to use ALSO NON-FREE software.
After 3 minutes or so you can also select the "volatile updates" option and continue with "Select and install software".
The following steps are for systems with complete "CC_share like" installation and for complete new installations.

You can copy and paste the commands in your putty console but do´nt forget to insert your username instead of <username>
code:

mkdir /emu
mkdir /emu/mpcs
mkdir /emu/script
mkdir /emu/log
chmod 777 /emu
chmod 777 /emu/*
chown <username> /emu
chown <username> /emu/*
vim /emu/script/mpcs

Now you must push "i" on your keyboard and insert the following
Code:

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

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

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.
Next commands are
code:

chmod 755 /emu/script/mpcs
ln /emu/script/mpcs /bin/mpcs
aptitude install proftpd


During the install of proftpd comes a quest to select YES if you shure to install it, so you have to select YES.
On the next question you should choose "stand-alone".

Rename mpcs-pre_09e to mpcs and use your ftp programm (filezilla) to upload mpcs, ignore.list, mpcs.ac, mpcs.cert, mpcs.conf, mpcs.guess, mpcs.ird, mpcs.server, mpcs.services, mpcs.srvid and mpcs.user to /emu/mpcs.

Next command is
code:

ln -s /emu/mpcs/ignore.list /usr/local/etc/ignore.list
ln -s /emu/mpcs/mpcs.ac /usr/local/etc/mpcs.ac
ln -s /emu/mpcs/mpcs.cert /usr/local/etc/mpcs.cert
ln -s /emu/mpcs/mpcs.conf /usr/local/etc/mpcs.conf
ln -s /emu/mpcs/mpcs.guess /usr/local/etc/mpcs.guess
ln -s /emu/mpcs/mpcs.ird /usr/local/etc/mpcs.ird
ln -s /emu/mpcs/mpcs.server /usr/local/etc/mpcs.server
ln -s /emu/mpcs/mpcs.services /usr/local/etc/mpcs.services
ln -s /emu/mpcs/mpcs.srvid /usr/local/etc/mpcs.srvid



Use putty again to give mpcs execution rights
Code:

chmod 755 /emu/mpcs/mpcs

Now you can simply start, stop or restart newcs in telnet by typing
code:

mpcs start
mpcs stop
mpcs restart

You should also use a config update script to update your mpcs.users file to a specified time in the night to prevent freezers in the primetime during updating your mpcs.users file
Code:

vim /emu/script/configupdate_mpcs.sh

Now you must push "i" on your keyboard and insert the following
Code:

#!/bin/sh
#Script to process new config and backup old one.
SOURCE=/emu/mpcs
TARGET=/usr/local/etc
FILE=mpcs.user
BACKUPDIR=/var/backup
CONFIGOLD=mpcs.oldie
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

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

Next commands are
Code:

chmod 755 /emu/script/configupdate_mpcs.sh
cd /etc
vim crontab

Now you must push "i" on your keyboard and insert the following at the bottom
Code:

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

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

With the next settings mpcs will start on the next reboot.
Code:

vim /etc/rc.local

Now you must push "i" on your keyboard and insert the following line in the free line before "exit0"
Code:

/bin/mpcs start &

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.


To prepare your mpcs for the use with cccam, mbox, evocamd and mgcamd you must prepare your cardreader in mpcs.server, assign caids to ports in mpcs.conf and create your user entries in mpcs.users.
I choose the newcs-protocol in my examples and the provider premie*e including the HD-Channels.
Check also the file /emu/log/mpcs.log after your first start of mpcs.
For further details read the files in the doc directory of mpcs.

You have to edit your mpcs.server with this values.
To do that enter the following
code:

vim /emu/mpcs/mpcs.server

Now you must push "i" on your keyboard
code:

[reader]
Label = N3HD
Protocol = mouse
Device = /dev/ttyS1
EMMCache = 1,3,2
Fallback = 0
Detect = CD
#CAID = 1702
Group = 1

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

In the mpcs.conf you can activate and edit your prefered protocol like this
code:

vim /emu/mpcs/mpcs.conf

Now you must push "i" on your keyboard
code:

[global]
Nice = -1
MaxLogsize = 100
ClientTimeout = 5
Level = 15
ClientMaxIdle = 120
CacheDelay = 20
BindWait = 60
ResolveDelay = 15
LogFile = /emu/log/mpcs.log
#LogFile = stdout
Sleep = 0

[monitor]
Port = 0
NoCrypt = 127.0.0.1
NoCrypt = 10.0.0.0-10.255.255.255
NoCrypt = 172.16.0.0-172.31.255.255
NoCrypt = 192.168.0.0-192.168.255.255
HideClient_TO = 1
AULow = 120
MonLevel = 1

[anticasc]
enabled =1
numUsers =1
sampleTime =3
penalty =0
acLogFile =/tmp/aclog.log
fakeDelay =200
samples =10
denySamples =9


[newcamd]
Key = 0102030405060708091011121314
#Port = 17000@1833:FFFFFF
Port = 17000@1702:FFFFFF;17001@1833:FFFFFF;17002@1801:FFF FFF


#[radegast]
#Port = 60000
#User = tuner
#Allowed = 192.168.178.10-192.168.178.20


#[cs378x]
#Port = 11005
#Port = 11005@1702:FFFFFF;11006@1722:FFFFFF;11007@1801:FFF FFF;11008@1833:FFFFFF

#[cs357x]
#Port = 11005


#[gbox]
#Password = 9ADFA417
#MaxDist = 4
#CardInfos = cards.info
#IgnoreList = ignore.list
#OnlineInfos = share.onl
#Locals = 17220000,18010501,0D220400

#[camd35]
#Port = 11005


Save it by pushing "Esc" followed by "ZZ" on your Keyboard.


To activate some users you´ve also to edit the mpcs.users file in this way
code:

vim /emu/mpcs/mpcs.users

Now you must push "i" on your keyboard
code:

[account]
User = au
Pwd = au
Group = 1
MonLevel = 0
AU = N3HD
CAID = 1702,1801,1833
#Betatunnel = <caid>.<sid>:<tunneled sid>,<caid>.<sid>:<tunneled sid>
Betatunnel = 1833.0081:1702,1833.0082:1702

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.


A working N-line for cccam would look like this, if cccam runs on the same computer:

N: 127.0.0.1 17000 au au 01 02 03 04 05 06 07 08 09 10 11 12 13 14

For the HD-Channels you´ll need a extra line like this, where port 17001 is assigned to caid 1833 which is used by the HD-Channels:

N: 127.0.0.1 17001 au au 01 02 03 04 05 06 07 08 09 10 11 12 13 14



Preparation for CCcam on the same pc
code:

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

Now you must push "i" on your keyboard
code:

#!/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 "Restarting $CAMNAME"
stop_cam
start_cam
;;
*)
"$0" stop
exit 1
;;
esac
exit 0

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

code:

chmod 755 /emu/script/cccam
ln /emu/script/cccam /bin/cccam
chmod 755 /emu/cccam/CCcam.x86
vim /emu/script/configupdate_cccam.sh

Now you must push "i" on your keyboard
code:

#!/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


Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

code:

chmod 755 /emu/script/configupdate_cccam.sh
cd /etc
vim crontab

Now you must push "i" on your keyboard
code:

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

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.


To put cccam in bootsequence use
Code:

vim /etc/rc.local

Now you must push "i" on your keyboard and add this line at the bottom
code:

/bin/cccam start &

Save it by pushing "Esc" followed by "ZZ" on your Keyboard.

If you now add this 2 lines to your CCcam.cfg you´ll be connected to your card in mpcs via newcs protocoll

N: 127.0.0.1 17000 au au 01 02 03 04 05 06 07 08 09 10 11 12 13 14
N: 127.0.0.1 17001 au au 01 02 03 04 05 06 07 08 09 10 11 12 13 14

Your controls via telnet are
code:

mpcs start
mpcs stop
mpcs restart

cccam start
cccam stop
cccam restart


Now you should reboot the server and check that MPCS and CCcam are running.

Keep on sharing and try also the combinations with newcs and others. ''