Merge pull request #4 from maddox/install-script

Install script
This commit is contained in:
Joseph Tyler Jones 2018-12-13 22:04:45 -08:00 committed by GitHub
commit f9c489c350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -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!

18
script/install Executable file
View File

@ -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."