Springen naar inhoud


Foto

softcam startup script more universal

softcam

  • Please log in to reply
Er zijn 36 reacties in dit onderwerp

#1 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 13 oktober 2012 - 13:32

Hi,

Some people that want to use a more recent version of there softcam (oscam for exemple) find it sometimes hard to change the version.

I have then slightly rewrote the softcam startup script to have clearly separated softcam exe and parameters, so the startup script can become more universal for any softcam.

Can perhaps be a best pratice to use this new softcam startup script method for all the current available softcam in the repository.

Here is the script:


#!/bin/sh
# Define parameters here
# start-exe = executable to launch
# softcam_param = full command line parameters to pass to executable
# softcam_version = For information only, version of the executable
softcam_exe="/usr/bin/oscam-experimental"
softcam_param="-b -r 2 -c /etc/tuxbox/config/oscam-experimental"
softcam_version="1.20"

remove_tmp ()
{
 [ -e /tmp/ecm.info ] && rm -rf /tmp/ecm.info
 [ -e /tmp/.oscam ] && rm -rf /tmp/.oscam
 [ -e /tmp/.console ] && rm -rf /tmp/.console
 [ -e /tmp/camd.socket ] && rm -rf /tmp/camd.socket
 }

 case "$1" in
start)
exec start-stop-daemon -S -x $softcam_exe -- $softcam_param
;;
stop)
exec start-stop-daemon -K -R 2 -x $softcam_exe &
sleep 2
ps | grep $softcam_exe | grep -v grep > /dev/null
if [ $? -eq 0 ]
then
killall -9 $softcam_exe 2>/dev/null
fi
sleep 2
remove_tmp
;;
 restart|reload)
$0 stop
sleep 1
$0 start
;;
 version)
echo $softcam_version
;;
 info)
  echo "oscam"
  ;;
 values)
echo "Command line started:" 
echo $softcam_exe $softcam_param
;;
 *)
echo "Usage: $0 start|stop|restart|version|info|values"
exit 1
;;
 esac
 exit 0


Tested with different OScam version. I don't know if the info parameter is used somewhere in OpenPli so I leave it that way and add my own new options "values" that will display what the command line used to start the emu looks like.

Pr2

NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: softcam startup script more universal #2 alsat1

  • Senior Member
  • 221 berichten

+1
Neutral

Geplaatst op 13 oktober 2012 - 14:16

can you please give example for gbox?regards.

Re: softcam startup script more universal #3 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 13 oktober 2012 - 15:15

Hi,

It should be easy but I don't use gbox, so I have no idea what are the command line parameter to tell him where to look for the configuration file.

You place your gbox executable into for exemple /usr/bin don't forget to chmod 755.

You take the content of the script and create:

/etc/init.d/softcam.gbox
chmod 755 /etc/init.d/softcam.gbox

You place the values that you want into:
softcam_exe="/usr/bin/gbox"
softcam_param="The parameters that you need to pass to gbox"
softcam_version="just information you place the gbox version"

You go in the Openpli GUI and you select gbox and restart the softcam.

Pr2
P.S.: I just figure out that I should have create also softcam_info as variable. for the info) section so in your case replace oscam with gbox there.
I also wrote a wiki (in french sorry) on how to play with softcam on OpenPli image:
http://www.streamboa...x#Image_OpenPli

NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: softcam startup script more universal #4 lateigne

  • Member
  • 32 berichten

0
Neutral

Geplaatst op 20 maart 2014 - 14:51

Hello,

How to modify this script to run 2 softcam?

Thanks


MaxDigital XP1000 (1XDVBS2)
TripleDragon (1XDVBS)

Re: softcam startup script more universal #5 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 22 maart 2014 - 21:05

Duplicate all paramaters softcam_ for exemple softcam2_XXX and duplicate all lines in sript that refers to softcam_  and change all occurences of softcam_ by softcam2_ on those duplicated lines.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: softcam startup script more universal #6 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 30 maart 2014 - 15:20

Hi,

 

Here is the full script to launch 2 softcams in the same startup script in Openpli.

 

#!/bin/sh
# Define parameters here
# softcam1_exe = executable to launch for 1st softcam
# softcam1_param = full command line parameters to pass to executable 1st softcam
# softcam2_exe = executable to launch for 2nd softcam
# softcam2_param = full command line parameters to pass to executable 2nd softcam
softcam1_exe="/usr/bin/oscam"
softcam1_param="-b -r 2 -c /etc/tuxbox/config/oscam"
 
softcam2_exe="/usr/bin/OSEmu"
softcam2_param="-a user:password -p 12000 -b"
 
softcam_info="OScam and OSemu"
 
 
remove_tmp ()
{
 [ -e /tmp/ecm.info ] && rm -rf /tmp/ecm.info
 [ -e /tmp/.oscam ] && rm -rf /tmp/.oscam
 [ -e /tmp/.console ] && rm -rf /tmp/.console
 [ -e /tmp/camd.socket ] && rm -rf /tmp/camd.socket
 }
 
 
 case "$1" in
start)
start-stop-daemon -S -x $softcam1_exe -- $softcam1_param
start-stop-daemon -S -x $softcam2_exe -- $softcam2_param
;;
stop)
start-stop-daemon -K -R 2 -x $softcam1_exe
start-stop-daemon -K -R 2 -x $softcam2_exe
sleep 3
ps | grep $softcam1_exe | grep -v grep > /dev/null
if [ $? -eq 0 ]
then
killall -9 $softcam1_exe 2>/dev/null
fi
ps | grep $softcam2_exe | grep -v grep > /dev/null
if [ $? -eq 0 ]
then
killall -9 $softcam2_exe 2>/dev/null
fi
sleep 2
remove_tmp
;;
 restart|reload)
$0 stop
sleep 2
$0 start
;;
 version)
$softcam1_exe -V | head -n 1 | awk '{print $2}'
;;
 info)
  echo $softcam_info
  ;;
 values)
echo "Command line started:" 
echo $softcam1_exe $softcam1_param
echo $softcam2_exe $softcam2_param
;;
 *)
echo "Usage: $0 start|stop|restart|version|info|values"
exit 1
;;
esac
exit 0

 

Enjoy!


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: softcam startup script more universal #7 MiLo

  • PLi® Core member
  • 14042 berichten

+298
Excellent

Geplaatst op 30 maart 2014 - 18:40

Replace:
<command>
if $? -eq 0 ; then
with
if <command> ; then
Instead of
grep ... > /dev/null
Simply use
grep -q ...

Veranderd door MiLo, 30 maart 2014 - 18:41

Real musicians never die - they just decompose

Re: softcam startup script more universal #8 lateigne

  • Member
  • 32 berichten

0
Neutral

Geplaatst op 30 maart 2014 - 18:51

Hi pr2 and Milo,

thanks for the answer.

 

Merci!


MaxDigital XP1000 (1XDVBS2)
TripleDragon (1XDVBS)

Re: softcam startup script more universal #9 balkanac

  • Senior Member
  • 85 berichten

+6
Neutral

Geplaatst op 21 september 2014 - 14:47

Hello....

Do you somebody have script for unicam emu?

If you have, please, put in this place, or send me on PM.

I have DM 800HD SE Ferrari card, and OpenPLI 2.1

Thanks!!!


Veranderd door balkanac, 21 september 2014 - 14:48


Re: softcam startup script more universal #10 hemertje

  • Forum Moderator
    PLi® Core member
  • 33469 berichten

+118
Excellent

Geplaatst op 21 september 2014 - 20:16

we do not support Ferrari Card clone boxes or do we build images for it


on the Glassfibre 1GB DVB-C...


Re: softcam startup script more universal #11 balkanac

  • Senior Member
  • 85 berichten

+6
Neutral

Geplaatst op 21 september 2014 - 21:58

@hemertje

 

I have two Dreamboxes, other is original 800HD SE. If you have script for unicam, please, give me on PM, or this page.

Thanks!!



Re: softcam startup script more universal #12 sportfootbol

  • Senior Member
  • 171 berichten

+21
Neutral

Geplaatst op 21 september 2014 - 22:00

Unicam emu is unique for all versions openpli....Only if someone wants to set up a script for this very good emu...Thanks...



Re: softcam startup script more universal #13 MiLo

  • PLi® Core member
  • 14042 berichten

+298
Excellent

Geplaatst op 22 september 2014 - 13:56

Just install the "custom" softcam, and edit the script.


Real musicians never die - they just decompose

Re: softcam startup script more universal #14 sportfootbol

  • Senior Member
  • 171 berichten

+21
Neutral

Geplaatst op 22 september 2014 - 18:17

unicam.sh.....

#!/bin/sh

OSD="unicam"
PID=`pidof unicam`
Action=$1

cam_clean () {
        rm -rf /tmp/*.info*    /tmp/*.tmp*
}

cam_handle () {
        if test    -z "${PID}"    ; then
                cam_up;
        else
                cam_down;
        fi;
}

cam_down ()    {
        killall    unicam
        sleep 2
        cam_clean
}

cam_up () {
        /usr/bin/cam/unicam -c /etc/tuxbox/config &
}

if test    "$Action" =    "cam_res" ;    then
        cam_down
        cam_up
elif test "$Action"    = "cam_down" ; then
        cam_down
elif test "$Action"    = "cam_up" ; then
        cam_up
else
        cam_handle
fi

exit 0

 

Please what would a script for openpli ...



Re: softcam startup script more universal #15 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 22 september 2014 - 18:32

Take my first script and replace those 2 lines:

 

softcam_exe="/usr/bin/oscam-experimental"
softcam_param="-b -r 2 -c /etc/tuxbox/config/oscam-experimental"

 

By:

 

softcam_exe="/usr/bin/cam/unicam"

softcam_param="-c /etc/tuxbox/config"

 

That's all you need to change.

 

Pr2

 


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: softcam startup script more universal #16 sportfootbol

  • Senior Member
  • 171 berichten

+21
Neutral

Geplaatst op 22 september 2014 - 19:59

Sorry ,not work ...OpenPli 2.1 image


Veranderd door sportfootbol, 22 september 2014 - 20:01


Re: softcam startup script more universal #17 balkanac

  • Senior Member
  • 85 berichten

+6
Neutral

Geplaatst op 22 september 2014 - 21:26

I confirm, don`t work with OpenPLi 2.1

Any other solutions?



Re: softcam startup script more universal #18 sportfootbol

  • Senior Member
  • 171 berichten

+21
Neutral

Geplaatst op 28 september 2014 - 14:01

has anyone tried to make a script for this extra fast emu.....Thanks...



Re: softcam startup script more universal #19 kaligola

  • Member
  • 4 berichten

0
Neutral

Geplaatst op 14 mei 2015 - 15:42

need me too script for unicam, is it 

 

Take my first script and replace those 2 lines:

 

softcam_exe="/usr/bin/oscam-experimental"
softcam_param="-b -r 2 -c /etc/tuxbox/config/oscam-experimental"

 

By:

 

softcam_exe="/usr/bin/cam/unicam"

softcam_param="-c /etc/tuxbox/config"

 

That's all you need to change.

 

Pr2

need to make script for  start/stop  unicam ,



Re: softcam startup script more universal #20 Pr2

  • PLi® Contributor
  • 6046 berichten

+256
Excellent

Geplaatst op 14 mei 2015 - 16:41

The script is universal simply change the two mentionned parameters.

NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 




Also tagged with one or more of these keywords: softcam

1 gebruiker(s) lezen dit onderwerp

0 leden, 1 bezoekers, 0 anonieme gebruikers