Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- gpio mode 7 down
- while ( true ); do
- gpio4=`/usr/local/bin/gpio read 7`
- if [ "$gpio4" -eq "0" ]; then
- #logger GPIO 4 is $gpio4, shutting down!
- #shutdown -h now
- echo "PRESSED"
- fi
- # a small delay
- sleep 0.5
- # for debugging just show the pin value
- echo $gpio4
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement