Merge pull request #14 from Howchoo/feature/uninstall-script

Feature/uninstall script
This commit is contained in:
Joseph Tyler Jones 2020-01-29 15:32:38 -08:00 committed by GitHub
commit 26fb7dcc60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View File

@ -8,4 +8,8 @@ Scripts used in our official [Raspberry Pi power button guide](https://howchoo.c
1. Clone this repo: `git clone https://github.com/Howchoo/pi-power-button.git`
1. Run the setup script: `./pi-power-button/script/install`
That's it!
## Uninstallation
If you need to uninstall the power button script in order to use GPIO3 for another project or something:
1. Run the uninstall script: `./pi-power-button/script/uninstall`

View File

@ -15,4 +15,5 @@ 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 listener installed."
echo "Shutdown listener installed.\n"
echo "Check out howchoo.com for more awesome Pi projects!"

16
script/uninstall Executable file
View File

@ -0,0 +1,16 @@
#! /bin/sh
set -e
cd "$(dirname "$0")/.."
echo "=> Stopping shutdown listener...\n"
sudo update-rc.d listen-for-shutdown.sh remove
sudo /etc/init.d/listen-for-shutdown.sh stop
echo "=> Removing shutdown listener...\n"
sudo rm -rf /usr/local/bin/listen-for-shutdown.py
sudo rm -rf /etc/init.d/listen-for-shutdown.sh
echo "Shutdown listener uninstalled.\n"
echo "Check out howchoo.com for more awesome Pi projects!"