Oscam auto update script for ubuntu

There are 31 replies in this Thread which was already clicked 26,023 times. The last Post () by weejake.

  • Hi master G


    I assumed that you and the rest of the team where very busy and well done for all your hard work getting this great forum back up and running. I will explain now how I got it working in the end. I formatted with a fresh install of ubuntu 10.10 and I did use the CCcam/Oscam auto install file. It installed with no problems whatsoever and ran very well. I decided I wanted to install the Oscam Auto Update script as I wanted to use the latest build and after following the instructions I could not get it to run as it should. However I searched high and low for reasons why it wouldn't run properly and I came up with this bit of info. When you install a fresh Ubuntu op system it doesn't for whatever reason even after updating it fully install all the applications you need to build the files, directory's etc u need to run the script. You have to install them yourself. Here is the list I had to install before it would run. (These words are not mine I found them elsewhere but they worked for me)


    This is a little howto for compiling oscam on some linux computers (debian, ubuntu, ...)


    you need these prerequisites before starting (they can be installed with this command sudo apt-get install <package_name> or with synaptic) :


    build-essential
    g++
    libssl-dev
    libusb-1.0-0-dev
    libpcsclite-dev
    cmake


    sample : sudo apt-get install libssl-dev


    After I had installed these I followed the instructions at the start of this thread.


    sudo mkdir /var/local/bin/


    I then did


    sudo nano /var/local/bin/oscam_update.sh


    I then went to the above file and inserted the following content bellow. (The only thing I changed was the http address it go's to for the latest oscam version)


    ###### #### ##### ##### ### ###
    ## ## ## ## ## ## ## ## ##
    ## ## ##### ## ####### ## ## ##
    ## ## ## ## ## ## ## ##
    ###### #### ##### ## ## ## ## R


    ####################################################################
    # 18 Jan 2011
    # By: billyk
    # Description: Automaticaly check and update to latest oscam version
    # Also restars it after update
    ####################################################################
    # - You can modify it to fit your needs :)
    # - Add # infront of any line that you don't want to execute
    ####################################################################
    echo "--> 1rst go to oscam's dir"
    cd /usr/local/bin
    echo " [ OK ] "
    echo "--> Backup previus version"
    #you must create a folder named: oscam_backups under /usr/local/bin
    sudo mv ./oscam ./oscam_backups/oscam_$(date +%m-%d-%Y-%H:%M)
    echo " [ OK ] "
    echo "--> Let's remove old folder..."
    sudo rm -rf oscam-svn
    echo " [ OK ] "
    echo "--> Checking for latest version and create oscam-svn dir..."
    sudo svn co http://streamboard.gmc.to/svn/oscam/trunk oscam-svn
    echo " [ OK ] "
    echo "--> Change dir to: oscam-svn"
    cd oscam-svn/
    echo " [ OK ] "
    echo "--> Create new folder: build_dir"
    sudo mkdir build_dir
    echo " [ OK ] "
    echo "Change dir to: build_dir"
    cd build_dir
    echo " [ OK ] "
    echo "--> Compile new version with Smargo smartreader support"
    sudo cmake -DHAVE_LIBUSB=1 /usr/local/bin/oscam-svn


    # You must have the needed libs to run smartreader with oscam.
    # If you do not want smartreader support...
    # ...simply remove [-DHAVE_LIBUSB=1]
    # so you will have this line:
    # sudo cmake /usr/local/bin/oscam-svn


    echo " [ OK ] "
    echo "--> Now... make!"
    sudo make
    echo " [ OK ] "
    echo "--> Finally we install the latest fersion..."
    sudo make install
    echo " [ OK ] "
    echo "---> ...so it's time to clean..."
    sudo make clean
    echo "OK. Now you have the latest oscam version!"


    #########################################################################
    # Also you can stop and start oscam from this script
    # The only thing you have to do is to remove the # from following lines...
    ##########################################################################
    if ps x |grep -v grep |grep -c oscam >/dev/null
    then
    echo "Oscam is running so we will stop it & restart it"
    sudo killall -9 oscam
    echo "Oscam killed"
    sleep 1
    echo "...so going to start it"
    sudo /usr/local/bin/oscam -b &
    echo "Done. Oscam is running!"
    echo "If oscam's settings are OK, you will have picture at 5 to 10 seconds!"
    echo "Chears! :)"
    else
    echo "Starting oscam..."
    sudo /usr/local/bin/oscam -b &
    fi
    ##########################################################################


    I then went to /usr/local/bin and created a folder called oscam_backups


    I then used the command


    sudo chmod 755 /var/local/bin/oscam_update.sh


    Then I ran it using the command


    sudo /var/local/bin/oscam_update.sh


    It ran removed the old oscam, placed it in the oscam_backups folder and then placed the latest version of oscam with Smartreader support in it's place and restarted everything.


    Hope this helps someone out


    Regards

  • Im running OSCAM 1.20-unstable_svn build #6686. does it support omnikey? sorry if it silly question because see smartgo reader

  • I tryed to do this thinking it might fix my wee problem with connecting and I've now lost all oscam . Scrips config are still there in server and cccam can still be got at but can log into oscam. I'm so frustrated .

  • If you read through this thread you would have seen that this update script was for oscam that was compiled locally, not oscam that came in auto-install script. To update "anto-install script" version of oscam, follow post 3 in this thread:




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • I didnt for one minute think it would be anything other than me not knowing what im doing again lol.
    Just though you might know whats wrong,all the configs are still there i can still get onto cccam server in webif but no ocam in webif and all boxes are not recieving.
    I tryed that 755 command and it said no directory so i think ive done something when i was sending commands.

  • Hello all
    would like to thank all the guys for there great work but I have a problem this script works great if your oscam called oscam but mine is called oscam1 and oscam2 so is there a script out there that will up date mine ?

  • #! /bin/sh
    ### BEGIN INIT INFO
    # Provides: Oscam
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Oscam init script
    # Description: Launch oscam at startup
    ### END INIT INFO DAEMON=/usr/local/bin/oscam
    DEAMON_OPTS="-b -r 2"
    PIDFILE=/var/run/oscam.pid test -x ${DAEMON} || exit 0 . /lib/lsb/init-functions case "$1" in
    start)
    log_daemon_msg "Starting OScam"
    start-stop-daemon --start --quiet --background --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} -- ${DAEMON_OPTS}
    log_end_msg $?
    ;;
    stop)
    log_daemon_msg "Stopping OScam"
    start-stop-daemon --stop --exec ${DAEMON}
    log_end_msg $?
    ;;
    force-reload|restart)
    $0 stop
    $0 start
    ;;
    *)
    echo "Usage: /etc/init.d/oscam {start|stop|restart|force-reload}"
    exit 1
    ;;
    esac exit 0


    Service startup script:


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


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


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


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


    ###### #### ##### ## ## ## ## R



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


    # 18 sep 2011


    # By: billyk


    # Description: Automaticaly check and update to latest oscam version


    # Also restars it after update


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


    # - You can modify it to fit your needs :)


    # - Add # infront of any line that you don't want to execute


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


    echo "--> 1rst go to oscam's dir"


    cd /usr/local/bin


    echo " [ OK ] "


    echo "--> Backup previus version"


    #you must create a folder named: oscam_backups under /usr/local/bin


    sudo mv ./oscam ./oscam_backups/oscam_$(date +%m-%d-%Y-%H:%M)


    echo " [ OK ] "


    echo "--> Let's remove old folder..."


    sudo rm -rf oscam-svn


    echo " [ OK ] "


    echo "--> Checking for latest version and create oscam-svn dir..."


    sudo svn co http://www.streamboard.tv/svn/oscam/trunk oscam-svn


    echo " [ OK ] "


    echo "--> Change dir to: oscam-svn"


    cd oscam-svn/


    echo " [ OK ] "


    echo "--> Create new folder: build_dir"


    sudo mkdir build_dir


    echo " [ OK ] "


    echo "Change dir to: build_dir"


    cd build_dir


    echo " [ OK ] "


    echo "--> Compile new version with Smargo smartreader support"


    sudo cmake -DHAVE_LIBUSB=1 /usr/local/bin/oscam-svn



    # You must have the needed libs to run smartreader with oscam.


    # If you do not want smartreader support...


    # ...simply remove [-DHAVE_LIBUSB=1]


    # so you will have this line:


    sudo cmake /usr/local/bin/oscam-svn



    echo " [ OK ] "


    echo "--> Now... make!"


    sudo make


    echo " [ OK ] "


    echo "--> Finally we install the latest fersion..."


    sudo make install


    echo " [ OK ] "


    echo "---> ...so it's time to clean..."


    sudo make clean


    echo "OK. Now you have the latest oscam version!"



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


    # Also you can stop and start oscam from this script


    # The only thing you have to do is to remove the # from following lines...


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


    if ps x |grep -v grep |grep -c oscam >/dev/null


    then


    echo "Oscam is running so we will stop it & restart it"


    sudo killall -9 oscam


    echo "Oscam killed"


    sleep 1


    echo "...so going to start it"


    sudo /usr/local/bin/oscam -b &


    echo "Done. Oscam is running!"


    echo "If oscam's settings are OK, you will have picture at 5 to 10 seconds!"


    echo "Chears! :)"


    else


    echo "Starting oscam..."


    sudo /usr/local/bin/oscam -b &


    fi


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

  • i have used this scrip to auto update oscam.. and is working well .....does anyone know how to include icam into this script so that it build oscam with icam emu

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!