11/04/2011
Oscam Auto Update Script on Dreambox and other linux recivers
with this script you can autoupdate the lastest oscam version
Oscam is an open-source project and the developers constantly update the SVN.
I have some Dreamboxes at home and I like to have my oscam up to date so I created a script for dreambox that downloads the latest binaries from UMP FileCenter and updates my oscam. I run this script every day at 5:00 AM using cronjobs.
Here is the script for Dreambox 800HD (should work on all enigma 2 dreamboxes).
If your oscam script is not /usr/script/oscam.emu then you have to adapt the start and stop commands to your own box.
Download this script and upload it to the /usr/script folder on dreambox and set the permissions to 755.
To execute the update just telnet to the box and execute the command sh /usr/script/oscam-update.sh.
Alternatively you can set a cronjob to execute the script at a given time (ie: everyday at 5:00 AM) which really make the process completely automatic.
#!/bin/sh
#CONFIGURATION
# The location of your oscam binary
OSCAM_BIN="/usr/bin/oscam";
# Command to stop the running oscam
STOP_OSCAM_CMD="/usr/script/oscam.emu stop";
# Command to start oscam
START_OSCAM_CMD="/usr/script/oscam.emu start";
# Use "mips-tuxbox" if you are on mips (enigma2) dreambox (Models: 500HD, 7020HD, 7025, 7025+, 800HD, 800HD SE, 8000)
PLATFORM="mips-tuxbox";
# Use "powerpc-tuxbox" if you are on powerpc (enigma1) dreambox (Models: 7000, 56x0, 500, 500+, 600, 7020)
#PLATFORM="powerpc-tuxbox";
#PROCESS UPDATE
cd /tmp
echo "Downloading UMP FileCenter index file...";
wget -O "ump.tmp" "http://download.oscam.to/index.php?&direction=0&order=mod&directory=$DIRECT ORY&"
echo "Checking for latest revision on UMP...";
html=$(cat ump.tmp)
ft="index.php?action=downloadfile&filename=oscam-svn"
st="-light-Distribution.tar.gz&directory=OSCam&"
revision=${html#*$ft}
revision=${revision%%$st*}
if (expr "$revision" : '-\?[0-9]\+$' > /dev/null) then
filename="oscam-svn$revision-$PLATFORM";
echo "Downloading revision $revision from UMP...";
wget -O "latest_oscam.tar.gz" "http://www.ump2002.net/$ft$revision$st"
echo "Extracting Oscam binary for $PLATFORM...";
tar -xvzf latest_oscam.tar.gz $filename
if [ -f $filename ]; then
echo "Stopping currently running Oscam...";
$STOP_OSCAM_CMD
echo "Copying the new version to $OSCAM_BIN";
cp -f $filename $OSCAM_BIN
echo "Starting Oscam";
$START_OSCAM_CMD
echo "Update process completed!";
else
echo "Unable to extract latest version from archive. Aborting.";
fi
else
echo "Unable to get latest revision from UMP. Operation Aborted!";
fi
echo "Cleaning up temporary files...";
rm ump.tmp
rm latest_oscam.tar.gz
rm $filename
cd ~
echo "All done!";
Display More
Enjoy it!