Stop osmc booting on a particular date?

Hi, Im looking to stop osmc booting on a particular date?

I dont know if theres a way to set it a number of days from today or give it a an exact date.

Any help would be brilliant as I need to teach my kid a thing or two :wink:

Do you mean booting, or are you concerned that it not reboot while it is up (for some unspecified reason)?
The only way to stop it booting up is to remove the power lead.
I know of no way of stopping a reboot.
Derek

Thansk for the reply first off Dan.

I meant is there a way to set a specific date to stop OSMC running after the Raspberry Pi is powered on? Sorry if im using the wrong terminology here…

Im not concerned about a reboot.

Who is Dan?
I think I get the idea, but there is still a point to clear up -
do you want to bring OSMC to a halt,
or to make sure the media centre function is stopped?
I suspect either of these could be implemented with a script under the control of cron, but I don’t posess the solution.
Derek

I seen Dan in your username and just went with it :smile:

I wan to stop the media centre function altogether.

Well thanks for your time any DEREK :wink:

Try looking at this kodi add-on, it might do what you want and a little more.

http://forum.kodi.tv/showthread.php?tid=228451

Jon

nano /home/osmc/lazy_parenting.sh

Add and save

curdate=$(date +%Y%m%d)
desireddate="20150730"
if [ "$curdate" -lt "$desireddate" ]
then
systemctl disable mediacenter
fi

Change desireddate value to date of ‘kill switch’.

Then

chmod +x /home/osmc/lazy_parenting.sh

Then

sudo nano /etc/rc.local

add

/home/osmc/lazy_parenting.sh

before exit 0

Sam

1 Like

San thanks you so much for the code. I have added it now and will try it when the clock hits midnight.

Really appreciate the effort you guys make for all this to happen and ill let you know if it works or not.

You will need to switch curdate and desireddate around I think (logic around the wrong way) or change the -lt to -gt - plus it will then stop it running from that date forward (not just the specific day).
You can fiddle with the -lt to check for being the same if you want to to stop it for only 1 day.
Note - this will be run on boot only.
If it is already running at 23:59 then it will continue to run through the next day until you reboot.

OK Sam and Paul. I tried both methods you guys gave me. The same thing happened with both your suggestions but it didnt stop the OSMC running.

Sam I tried yours in my first attempt and nothing happened at first, I then changed the %Y to a lowercase y and that sort of worked. “System start failure” in red, showed on the splash screen with more system files running after that but then OSMC loaded anyway.

I’ll explain what I did…

1st attempt: if [ “$curdate” -lt “$desireddate” ] “System start failure” in red showed

2nd attempt: if [ “$curdate” -gt “$desireddate” ] nothings happeened at all with this, OSMC loaded normally.

3rd attempt: if [ “$desireddate” -lt “$curdate” ] like above nothings happened at all. OSMC loaded normally.

4th attempt: if [ “$desireddate” -gt “$curdate” ] “System start failure” in red showed

So if you guys have any suggestoins it would be great and thanks for the help so far :smiley:

It probably says system start failure beause you broke the syntax of the script

Sam

Hey Sam, maybe I didnt explain it rightso sorry about that but I tried it again.

I had a spare sd card hanging around so I did a fresh install of OSMC and added your code and the steps exactly as you put in the message from your message on wednesday and doubled checked it. Heres an image of what pops up on the splash screen, after the very last line in the image osmc loads up as normal.

Any ideas?

Copy and paste your version of the script into here (do not retype it) so we can see if there are any mistakes.