Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
CoreELEC and kodi with scripts help
#1
HI all

There was a poster on CoreELEC that he wanted to exit kodi and reload it when he came out of suspend meaning a refresh of the system if you are using a shared data base to remember the place left of and what was watched Here is the script

Cooked up a small systemd service to automatically restart the Kodi service on resume from sleep. In case anyone needs it:

CoreELEC-BDR:~ # cat /storage/.config/system.d/onresume.service
[Unit]
Description=Restart Kodi after resume
After=suspend.target

[Service]
Type=simple
ExecStart=/bin/systemctl --no-block restart kodi.service
# ExecStart=/usr/bin/systemctl --no-block restart kodi.service

[Install]
WantedBy=suspend.target
CoreELEC-BDR:~ # systemctl enable onresume.service;systemctl start onresume.service

I am not sure where to put this script to make it run and what to copy and paste as the top and bottom line where in blue or even what to call the file. Can anyone help

Thanks
Reply
#2
As I understand the description you need to create a file called “onresume.service”.

Contents of the file:
Code:
[Unit]
Description=Restart Kodi after resume
After=suspend.target

[Service]
Type=simple
ExecStart=/bin/systemctl --no-block restart kodi.service
# ExecStart=/usr/bin/systemctl --no-block restart kodi.service

[Install]
WantedBy=suspend.target
Copy this file to the directory "/storage/.config/system.d/",
and activate it with the command via the ssh console:
Code:
systemctl enable onresume.service
Reply
#3
Thanks. For the help makes better sense.

But when you say

activate it with the command via the ssh console:

Does that mean I have to somehow do that myself or does that mean when the system reboots it activate it with the command via the ssh console on its own when drop this file in the location

Or does it mean every time I power down the system and reboot it I have to run this command line every time or just the once and it installs it permanently if so how do you deactivate it if u want to remove it thanks.

Sorry about this but used Kodi and xbmc for years on a pc and not used to android and how the system works yet.
Cheers
Reply
#4
(2024-05-14, 07:42)meridius Wrote: Or does it mean every time I power down the system and reboot it I have to run this command line every time or just the once and it installs it permanently if so how do you deactivate it if u want to remove it thanks.

No, only activate it once.

deactivate with:
Code:
systemctl disable onresume.service
Reply
#5
Cheers I will give it ago and let you know. Thanks
Reply
#6
Hi, sorry for not posting but i installed Puty and all i see is 


CoreELEC:~ # ls
backup             logfiles           pictures           videos
downloads          lost+found         recordings
emulators          music              screenshots
init-previous.log  picons             tvshows
CoreELEC:~ #


where is the /storage/.config/system.d folder ?  as i can not find it at all.

sorry 

thanks
Reply
#7
Use winscp + putty.
With winscp you should activate “show hidden files” in the settings.
Then you should see the desired file path.
"/storage/.config/" is a hidden folder.

Image
Reply

Logout Mark Read Team Forum Stats Members Help
CoreELEC and kodi with scripts help0