]>
git.gir.st - hardpass.git/blob - shutdown/shutdown-button.sh
3 # monitor GPIO pin 17 for shutdown signal
5 # export GPIO pin 17 and set to input with pull-up
6 echo "17" > /sys
/class
/gpio
/export
7 echo "in" > /sys
/class
/gpio
/gpio17
/direction
8 echo "high" > /sys
/class
/gpio
/gpio17
/direction
10 # wait for pin to go low
13 if [ "$(cat /sys/class/gpio/gpio17/value)" == '0' ]
15 echo "Raspberry Pi Shutting Down!"