Hi,
I wood like to ad a script which enables the posibility of a power button usage.
I found manauls to do that, but non of them worked at libreelec.
this are the script which should run:
As well the intallation script is not working.
Hope there is a way to add this simple funktionality to shutdown an restart the Pi with a shorting pin 5 and 6 (GPIO3 and GND)
Thx in advance
install:
Code
#! /bin/sh
set -e
cd "$(dirname "$0")/.."
echo "=> Installing shutdown listener...\n"
sudo cp listen-for-shutdown.py /usr/local/bin/
sudo chmod +x /usr/local/bin/listen-for-shutdown.py
echo "=> Starting shutdown listener...\n"
sudo cp listen-for-shutdown.sh /etc/init.d/
sudo chmod +x /etc/init.d/listen-for-shutdown.sh
sudo update-rc.d listen-for-shutdown.sh defaults
sudo /etc/init.d/listen-for-shutdown.sh start
Display More
listen-for-shutdown.sh
Code
#! /bin/sh
### BEGIN INIT INFO
# Provides: listen-for-shutdown.py
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# If you want a command to always run, put it here
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting listen-for-shutdown.py"
/usr/local/bin/listen-for-shutdown.py &
;;
stop)
echo "Stopping listen-for-shutdown.py"
pkill -f /usr/local/bin/listen-for-shutdown.py
;;
*)
echo "Usage: /etc/init.d/listen-for-shutdown.sh {start|stop}"
exit 1
;;
esac
exit 0
Display More
listen-for-shutdown.py