Sunday, October 11, 2009

Gbox Tricks

This is what I did to try to improve the gbox for my needs:
I made some scripts that will allow you to be able to select the distance where gbox will receive cards;












this can be useful if you have good servers at low distance but also some interesting cards at far distance that you want to use some time.

You can use Auto-Cam to automate this and select proper script depending of the distance of card for provider.




The idea is to have few cwshare_cfg configs with different lines I ( and X if required ):
With text editor copy/paste and save the file with right name.
Copy the scrips to /var/script with attribute 755.
Copy all the cwshare files in keys.
Restart box and now in Blue Panel you can see all the scripts.

I used 3 config files which are almost the same except the distance parameter I: { 0N }

cwsharb2.cfg have I: { 02 }
cwsharb3.cfg have I: { 03 }
cwsharb4.cfg have I: { 04 }

please note that my gbox file it is renamed as gbox_21bbecause I use alsogbox_225 with another script.

if you want to use both versions of gbox: 2.1b &2.25 patching of gbox_21b it is required, contact me for that trick.

Note the red line, that line will copy the right cwshare to be used and will do the trick.

This is the script for Gbox21b distance 2

file: gbox_21b2_cam.sh
################################################## #########################
CAMNAME="Gbox21b dist2"
USERNAME=
ZAPTIME=6
CAMID=002
DVBSET=1
INFOFILE="ecm.info"

# This method cleans up /tmp folder of gbox files
remove_tmp ()
{
rm -rf /tmp/*info* /tmp/*gbox* /tmp/*online* /tmp/*share* /tmp/Newcs* /tmp/atack* /tmp/debug*
}

# This method starts cardserver_6.1 > CS2Gbox > Gbox (That order)
start_cam ()
{
cp -f /var/keys/cwsharb2.cfg /var/keys/cwshare.cfg
/var/bin/gbox_21b &
}

# This method stops newcs cs2gbox and gbox and then calles the tmp cleanup method
stop_cam ()
{
touch /tmp/gbox_21b.kill
/bin/prockill gbox_21b
remove_tmp
}

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

This is the script for Gbox21b distance 3:

file: gbox_21b3_cam.sh
################################################## #########################
CAMNAME="Gbox21b dist2"
USERNAME=
ZAPTIME=6
CAMID=002
DVBSET=1
INFOFILE="ecm.info"

# This method cleans up /tmp folder of gbox files
remove_tmp ()
{
rm -rf /tmp/*info* /tmp/*gbox* /tmp/*online* /tmp/*share* /tmp/Newcs* /tmp/atack* /tmp/debug*
}

# This method starts cardserver_6.1 > CS2Gbox > Gbox (That order)
start_cam ()
{
cp -f /var/keys/cwsharb3.cfg /var/keys/cwshare.cfg
/var/bin/gbox_21b &
}

# This method stops newcs cs2gbox and gbox and then calles the tmp cleanup method
stop_cam ()
{
touch /tmp/gbox_21b.kill
/bin/prockill gbox_21b
remove_tmp
}

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

This is the script for Gbox21b distance 4:

file: gbox_21b4_cam.sh
################################################## #########################
CAMNAME="Gbox21b dist2"
USERNAME=
ZAPTIME=6
CAMID=002
DVBSET=1
INFOFILE="ecm.info"

# This method cleans up /tmp folder of gbox files
remove_tmp ()
{
rm -rf /tmp/*info* /tmp/*gbox* /tmp/*online* /tmp/*share* /tmp/Newcs* /tmp/atack* /tmp/debug*
}

# This method starts cardserver_6.1 > CS2Gbox > Gbox (That order)
start_cam ()
{
cp -f /var/keys/cwsharb4.cfg /var/keys/cwshare.cfg
/var/bin/gbox_21b &
}

# This method stops newcs cs2gbox and gbox and then calles the tmp cleanup method
stop_cam ()
{
touch /tmp/gbox_21b.kill
/bin/prockill gbox_21b
remove_tmp
}

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

################################################## #########################



I made another version of scripts.

For use that ver replace in previous scrips red line with the new ones
In this version you will have only one file for cwshare.cfg and parameter I and X will be replaced according to your data from each script.
This is easy because you will not have to edit each cfg after some changes.

- This is the script for Gbox21b distance 2 -
sed -e "s/I: { 0.*/I: { 02 }/" /var/keys/cwshare.cfg > /var/keys/cwshartmp.cfg
sed -e "s/X: { 0.*/X: { 05 }/" /var/keys/cwshartmp.cfg > /var/keys/cwshare.cfg
- This is the script for Gbox21b distance 3 -
sed -e "s/I: { 0.*/I: { 03 }/" /var/keys/cwshare.cfg > /var/keys/cwshartmp.cfg
sed -e "s/X: { 0.*/X: { 05 }/" /var/keys/cwshartmp.cfg > /var/keys/cwshare.cfg
- This is the script for Gbox21b distance 4 -
sed -e "s/I: { 0.*/I: { 04 }/" /var/keys/cwshare.cfg > /var/keys/cwshartmp.cfg
sed -e "s/X: { 0.*/X: { 05 }/" /var/keys/cwshartmp.cfg > /var/keys/cwshare.cfg

0 comments:

Post a Comment