time sync

D1GG3R

VIP Member
VIP Member
Premium Member
Joined
Jan 28, 2006
Messages
1,918
is there a script that we can put into dreambox to sync the time from an internet time server? ie before oscam starts??

i know this command works manually:

rdate -sp ntp2d.mcc.ac.uk

but i have no idea on how to make a script from it?

any ideas anyone?
 

PaphosAL

Veteran flasher
Joined
Jan 22, 2006
Messages
1,598
You shouldn't need to make a seperate script of it, digger. Just root around in the image and find the script where oscam is conditionally started from, then add your new line above that conditional section.

Cheers- AL :)
 

PaphosAL

Veteran flasher
Joined
Jan 22, 2006
Messages
1,598
Ah- I've just read your comment about Commando 14.4 in the other 'Cannot load channel lists' thread, so if it's C14.4 you want to add this command to, then it's eazy peazy! But do please use a proper text editor like Notepad++ or UltraEdit, and not Notepad / Wordpad...

The file you need to mod is /var/bin/miniops

scroll down to this part of the file at the bottom:

elif [ -e $FLAG/.oscam ] ; then
oscam &
fi
exit
;;
esac
exit 0

and paste your new line in like this:

elif [ -e $FLAG/.oscam ] ; then
rdate -sp ntp2d.mcc.ac.uk
oscam &
fi
exit
;;
esac
exit 0

If it doesn't seem to work as expected, then you might need to add this as well:

elif [ -e $FLAG/.oscam ] ; then
rdate -sp ntp2d.mcc.ac.uk
sleep 1
oscam &
fi
exit
;;
esac
exit 0

which will pause 1 second before oscam is started in the background, to give the rdate command a chance to grab hold. If it still doesn't work, then just keep adding sleep time in increments of 1 secs until it does work. Then add 1 more for luck, LOL!

Cheers- AL ;)
 

D1GG3R

VIP Member
VIP Member
Premium Member
Joined
Jan 28, 2006
Messages
1,918
WoW... thanks for the reply mate..

its not for the c14.4 image mate.. thats on another box :) .. its for a pli image..

ill have a look and follow your first post though.. ;)

Thanks..
 
Last edited:

PaphosAL

Veteran flasher
Joined
Jan 22, 2006
Messages
1,598
OIC, digger. I think I know which Image you're talking about, and as I was bored for half an hour, I just flashed that image on my testbox. Needed to remind myself on how OpenPLi goes about softcam control, LOL!

Okay, I think the script you need to tweak is /var/etc/plimgr/scripts/emusrv

Near the top, try changing this:

VERSION=1.04
EMUSCRIPTDIR=/var/etc/plimgr/scripts
BURLCGI="http://root:[email protected]/cgi-bin"

to instead read this:

VERSION=1.04
rdate -sp ntp2d.mcc.ac.uk
EMUSCRIPTDIR=/var/etc/plimgr/scripts
BURLCGI="http://root:[email protected]/cgi-bin"

Again, you might need to invoke a short delay with that sleep n command. That's the fun of testing!

Cheers- AL :)

and see what happens.
 

D1GG3R

VIP Member
VIP Member
Premium Member
Joined
Jan 28, 2006
Messages
1,918
cheers Al

ive tried that but oscam didnt start. added the sleep1 command and it still didnt start.. so ive now removed both and put it back as it was.. and oscam wont start lol :)

oscam normaly start on reboot on my box.. now its stopped?? ooops!
 

PaphosAL

Veteran flasher
Joined
Jan 22, 2006
Messages
1,598
Did you heed my warning about NOT using Notepad nor Wordpad to edit a 755 script file? Coz if you have, there will probably be hidden eol codes in there now, which fubars the script from executing...

If you have TuxCom plugin installed, navigate to that file and Linux Format it, then try over, with the FREEWARE Notepad++ Editor. >>> Edit > EOL Conversion > Unix Format (so it reads Unix - ANSI bottom right, instead of DOS /Windows - how you must have left it, LOL!)

Cheers- AL ;)
 

D1GG3R

VIP Member
VIP Member
Premium Member
Joined
Jan 28, 2006
Messages
1,918
all sorted mate... had to flash a backup image i had :)

That'll teach me not to fook about :)
 

PaphosAL

Veteran flasher
Joined
Jan 22, 2006
Messages
1,598
Been at this lark eight years now, so sometimes, the most common of sense gets left out, in case peeps think you're trying to teach them to suck eggs... But a few words of advice regarding existing scripts:

Never edit 'on the fly' inside the image itself.
Always ftp your target script file to pc
Then make a backup on pc
Then edit either one and ftp the saved version back to the image, overwriting original
If things go tits up, you can always start over again, using the original backup and ftp

In Notepad++ when it's a 755 script your creating / editing, if it says "DOS /Windows" bottom right, then the finished script will NOT function under Linux

It must read 'Unix - ANSI' for Linux format. Having wordwrap switched on is the usual culprit...

BTW- C14.4 has rdate support in busybox, not to mention oscam support in the Softcam Menu. :)
 

D1GG3R

VIP Member
VIP Member
Premium Member
Joined
Jan 28, 2006
Messages
1,918
Been at this lark eight years now, so sometimes, the most common of sense gets left out, in case peeps think you're trying to teach them to suck eggs... But a few words of advice regarding existing scripts:

Never edit 'on the fly' inside the image itself.
Always ftp your target script file to pc
Then make a backup on pc
Then edit either one and ftp the saved version back to the image, overwriting original
If things go tits up, you can always start over again, using the original backup and ftp

In Notepad++ when it's a 755 script your creating / editing, if it says "DOS /Windows" bottom right, then the finished script will NOT function under Linux

It must read 'Unix - ANSI' for Linux format. Having wordwrap switched on is the usual culprit...

BTW- C14.4 has rdate support in busybox, not to mention oscam support in the Softcam Menu. :)
some excellent guidance there mate... ;)

i should have backed up the file yesterday, before i fooked it up :)

i may have a bit more success now..

cheers
 
TEST
Top