Last active
August 29, 2015 14:26
-
-
Save TinajaLabs/967691d4bd62d3565d44 to your computer and use it in GitHub Desktop.
This is an init file for Raspberry Pi, Raspbian which can automatically launch a python script at boot-up
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/sh | |
# /etc/init.d/tinaja_sensors | |
### BEGIN INIT INFO | |
# Provides: tinaja_sensors | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Tinaja_Sensors initialisation | |
### END INIT INFO | |
<pre>PIDFILE=/var/run/tinaja_sensors.pid</pre> | |
<pre>case "$1" in | |
start) | |
echo "Starting Tinaja_Sensors" | |
# run application you want to start | |
python /home/tinaja/sensorgate2.py & | |
;; | |
stop) | |
echo "Stopping Tinaja_Sensors" | |
# kill application you want to stop | |
killall python | |
;; | |
restart) | |
echo "Restarting Tinaja_Sensors.." | |
$0 stop | |
$0 start | |
;; | |
*) | |
echo "Usage: /etc/init.d/tinaja_sensors start|stop" | |
exit 1 | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment