PowerOff options

I like my startup screens, nothing to do with cost, (don’t know about anyone else though) :wink:

Yeah, same for me! The most important reason for shutting down my box is fire safety as I don’t trust the cheap amlogic devices… I’ve even bought a FireProof MOV power outlet for all my cheap devices to be on the safe side

I use Harmony remotes so 1 button switches everything on. Since the TV takes a few seconds to boot, no real advantage in having the box come on instantly. :wink:

Gents, is there a way to activate particular add-on during shutdown ? I am using LG TV OFF screensaver as workaround to turn the TV off instead of “real” screensaver. However i would like to add this workaround as a part of KODI shutdown routine.

https://forum.kodi.tv/showthread.php?tid=245169

You could probably write a shutdown script to call the app. Google it (since nobody can give you any further clues with no idea of the hardware you’re using) :wink:

I have (VS) MECOOL KIII PRO 3G/16G, S912 running on 8.90.5 CoreELEC OS.

Yes, agree with the script, this what I found here and try to implement

However I am not able:
1.) To find shutdown.sh script where to place the call for an app
2.) Also how to call screensaver KODI add-on from that shutdown script

Can you point where to find the shutdown.sh and how to call the add on app ?

You’re on the right track there but you’ll have to figure the script out for yourself.
(We’re wandering off-topic for CoreELEC Help and Support, it’s scripting in general that you need to study up on).

Good luck :mortar_board:

Thanks, I am strying / reading but can not move further…

You know, my script is working when I launch it from the shell:

sh shutdown.sh

What it’s not working is to execute this script within KODI power off routine. I found several guides and none of them works, all of them are for LibreELEC which are pointing to kodi-poweroff.service which does not exist on CoreELEC or I did not find one.

1.) Can you help me where is this power off routine that I can include script to ?
2.) Or do I need to create one by myself ? If so, what command to execute to link the service to power off KODI routine ?

Put your file here and try:
/storage/.config/shutdown.sh

I did but nothing happens. Is there a way to verify whether it has been executed at least i.e. enable the logging ? DO you know where ?

This script is a bit complicated i.e. it requires network in order to work therefore has to be executed before network goes down. I found services like kodi-poweroff.service which can be configured the way it consider network but for LibreELEC.

Use this file as shutdown.sh and add any scripts or action in required section shutdown.sh (196 Bytes)

Thanks for the file, I just did but nothing happens. Just to be sure I executed script before shutdown (no issue), but not executed or working during shutdown, see details:

CoreELEC:~/.config # ls -l -a
total 88
drwxr-xr-x 16 root root 4096 Jul 22 17:06 .
drwxr-xr-x 23 root root 4096 Jul 22 15:41 …
drwxrwxr-x 2 root root 4096 Jul 16 23:52 aacs
-rw-r–r-- 1 root root 3 Jul 22 14:49 boot.status
-rw-rw-r-- 1 root root 284 Jun 23 09:55 hosts.conf
drwxrwxr-x 2 root root 4096 Jul 16 20:50 hwdb.d
drwxrwxr-x 2 root root 4096 Jul 16 21:53 iptables
drwxrwxr-x 2 root root 4096 Jul 16 20:50 logind.conf.d
drwxrwxr-x 2 root root 4096 Jul 16 23:51 modprobe.d
drwxrwxr-x 2 root root 4096 Jul 16 20:50 modules-load.d
drwx------ 2 root root 4096 Jul 22 14:49 pulse
drwxrwxr-x 2 root root 4096 Jul 16 23:51 pulse-daemon.conf.d
drwxrwxr-x 2 root root 4096 Jul 16 23:58 rc_keymaps
-rw-rw-r-- 1 root root 720 Jul 16 23:58 rc_maps.cfg.sample
-rw-rw-r-- 1 root root 4458 Jul 16 21:53 samba.conf.sample
-rwxr-xr-x 1 root root 225 Jul 22 17:06 shutdown.sh
drwxrwxr-x 2 root root 4096 Jul 16 20:50 sleep.conf.d
drwxrwxr-x 2 root root 4096 Jul 16 20:50 sysctl.d
drwxrwxr-x 4 root root 4096 Jul 16 20:50 system.d
drwxrwxr-x 2 root root 4096 Jul 16 20:50 tmpfiles.d
drwxrwxr-x 2 root root 4096 Jul 16 20:50 udev.rules.d
CoreELEC:~/.config # pwd
/storage/.config
CoreELEC:~/.config # cat shut*
#!/bin/sh

case “$1” in
#halt)
# your commands here

;;

poweroff|halt)
python3 /storage/downloads/lg_tv_control_lan.py 1
;;
reboot)
# your commands here
;;
*)
# your commands here
;;
esac
CoreELEC:~/.config # pwd
/storage/.config
CoreELEC:~/.config # python3 /storage/downloads/lg_tv_control_lan.py 1
CoreELEC:~/.config #

Maybe the script is executed but network is already down so the message is not send out to network.

Is there any way to execute the script before network goes down ?

I just did several other tests (folder creation to local vs. network) while script is being executed and only local folder have been created. Therefore shutdown.sh script is executed when network is already down.

Hi, I would like to asdk you for your help - I´m using Coreelec 8.90.5 on microSD card on Khadas Vim2 Max and from that system is impossible to power off. I tried it from CE menu and also power button on Khadas.

During power off blue led on Khadas only blinks and start again.

Do you have any idea, how to fix it?

The original OP query has been answered.
Nobody likes wading through a heap of marginally related posts.Time to start some new threads