commit
f9c489c350
|
@ -1,2 +1,10 @@
|
||||||
# pi-power-button
|
# pi-power-button
|
||||||
|
|
||||||
Scripts used in the [Pi power button guide](https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi) on howchoo.
|
Scripts used in the [Pi power button guide](https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi) on howchoo.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Clone down this repo to your Raspberry Pi
|
||||||
|
2. Run `script/install`
|
||||||
|
|
||||||
|
That's it!
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
echo "=> Installing shutdown listener...\n"
|
||||||
|
sudo mv listen-for-shutdown.py /usr/local/bin/
|
||||||
|
sudo chmod +x /usr/local/bin/listen-for-shutdown.py
|
||||||
|
|
||||||
|
echo "=> Starting shutdown listener...\n"
|
||||||
|
sudo mv 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
|
||||||
|
|
||||||
|
echo "Shutdown listner installed."
|
Loading…
Reference in New Issue