@ Alternativende:
The only thing, that confuses me in a bit is that "*" under the 'poweroff' section..
...
poweroff)
*
/storage/.config/fuckme.sh
;;
I would remove that.
and for the ultimative test, I would change the script to the following:
# cat /storage/.config/shutdown.sh
#set -x
case "$1" in
halt)
echo "halt" > /storage/test.txt
;;
poweroff)
echo "poweroff" > /storage/test.txt
;;
reboot)
echo "reboot" > /storage/test.txt
;;
*)
# your commands here
;;
esac
Display More
and then check /storage/test.txt what's in there. So you will know the "case" will work.
If you want, you could run that script via command line, as we already know that $1 should be 'poweroff' from your previous test.
Now we need to know why the 'case' might not work. To get a more verbose output remove the "#" from the '#set -x" line and start the script from command line like:
./storage/shutdown.sh poweroff
then, normally "poweroff" should be written to /storage/test.txt. You will see a lot of lines at the output of what the script exactly does. That's because of the "set -x" line you activated by removing the "#". And maybe you will see why the script fails. To change this massive output again, just add the "#" again in front of "set -x" or just remove that line completely.
And just for the cosmetics....LibreELEC, as the same as for OpenELEC, doesn't have bash....it has sh. So the shebang at the fuckme.sh shouldn't be:
#!/bin/bash
it should be
#!/bin/sh
shouldn't be a big problem. But I would change it, too ;).
For checking which shell is used, enter: echo $SHELL
Greetings