Oscam auto update script para ubuntu


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


# 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


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