Skip to content

Instantly share code, notes, and snippets.

@pdp7
Created September 17, 2012 05:00
Show Gist options
  • Save pdp7/3735637 to your computer and use it in GitHub Desktop.
Save pdp7/3735637 to your computer and use it in GitHub Desktop.
[timetemp] init script for Raspberry Pi to start display of time and temp on 7-segment display
### BEGIN INIT INFO
# Provides: time and temp on 7-segment
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: 7-segment display
# Description: time and temp
### END INIT INFO
#! /bin/bash
# /etc/init.d/timetemp
export HOME
case "$1" in
start)
echo "Starting timetemp"
/home/pi/timetemp/timetemp.sh &
;;
stop)
echo "Stopping timetemp"
KILL_PID=`ps auxwww | grep timetemp.sh | head -1 | awk '{print $2}'`
kill -9 $KILL_PID
KILL_PID=`ps auxwww | grep timetemp.py | head -1 | awk '{print $2}'`
kill -9 $KILL_PID
;;
*)
echo "Usage: /etc/init.d/timetemp {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