How can I run a shell script when my kodi (LibreELEC) box wakes from sleep?
Running scrpt at wake
-
labzilla -
March 28, 2023 at 4:42 PM -
Thread is Resolved
-
-
See ./storage/config/sleep.d/99-sample.power.x and create your 01-wake.power script
-
I don't have a file called /storage/.config/sleep.conf.d/99-sample.power.x
I have a README & sleep.conf.sample
I created a file in that directory called 99script.sh. Permission is 755. The script redirects the output of date to a file. But nothing happens after the system wakes up.
What am I missing?
-
-
I'm assuming it's supposed to be the /storage/.config directory, the dot is missing. I'm also assuming that anything in that directory that has execute permission will be executed.
Bash
Display More#!/bin/sh echo "Hello World" >> /storage/test.txt date >> /storage/test.txt case "$1" in pre) # <do something on suspend> ;; post) # <do something on resume> echo "Waking up" >> /storage/test.txt date >> /storage/test.txt ;; esac
/storage/test.txt is never created after a sleep/wake or reboot. Shouldn't myscript.power run whenever there is a power change?
-
I'm assuming it's supposed to be the /storage/.config directory, the dot is missing.
Yes.
I'm also assuming that anything in that directory that has execute permission will be executed.
Any *.power file is executed.
Is working on my LE11 Generic-legacy machine and logged to the journal:
-
Fixed. Had a typepo. Thanks for your help
-
Had a typepo.
^ It seems to be a recurring issue