-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathled_clock
More file actions
31 lines (27 loc) · 710 Bytes
/
led_clock
File metadata and controls
31 lines (27 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
### BEGIN INIT INFO
# Provides: led_clock
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LED clock
# Description: A simple clock & temperature application in Python for a 7-segment LED backpack
### END INIT INFO
#!/bin/sh
APP_HOME=/home/pi/python/py_led_clock
case "$1" in
start)
echo "Starting LED"
$APP_HOME/clock.py 2>&1 &
;;
stop)
echo "Stopping LED"
LED_PID=`ps auxwww | grep clock.py | grep -v grep | head -1 | awk '{print $2}'`
kill -USR1 $LED_PID
;;
*)
echo "Usage: /etc/init.d/led_clock {start|stop}"
exit 1
;;
esac
exit 0