Created
June 16, 2018 19:30
-
-
Save joeheyming/142e13731cc960a13babb6a809c1f33d to your computer and use it in GitHub Desktop.
Garage door init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# /etc/init.d/garagerelay | |
# Carry out specific functions when asked to by the system | |
case "$1" in | |
start) | |
echo "Starting Relay" | |
/usr/local/bin/gpio write 7 0 | |
/usr/local/bin/gpio mode 7 out | |
/usr/local/bin/gpio write 0 0 | |
/usr/local/bin/gpio mode 0 out | |
/home/pi/node/bin/node /home/pi/garage/server.js & | |
;; | |
stop) | |
echo "Stopping gpio" | |
;; | |
*) | |
echo "Usage: /etc/init.d/garagerelay {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment