Kodi Community Forum
CoreELEC and kodi with scripts help - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: CoreELEC and kodi with scripts help (/showthread.php?tid=377518)



CoreELEC and kodi with scripts help - meridius - 2024-05-13

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


RE: CoreELEC and kodi with scripts help - Fuchs2468 - 2024-05-14

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



RE: CoreELEC and kodi with scripts help - meridius - 2024-05-14

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


RE: CoreELEC and kodi with scripts help - Fuchs2468 - 2024-05-14

(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



RE: CoreELEC and kodi with scripts help - meridius - 2024-05-14

Cheers I will give it ago and let you know. Thanks


RE: CoreELEC and kodi with scripts help - meridius - 2024-05-19

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


RE: CoreELEC and kodi with scripts help - Fuchs2468 - 2024-05-19

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