-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemp
executable file
·37 lines (33 loc) · 965 Bytes
/
temp
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
32
33
34
35
36
37
### BEGIN INIT INFO
# Provides: LCD - date / time / ip address
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Liquid Crystal Display
# Description: date / time / ip address
### END INIT INFO
#! /bin/sh
# /etc/init.d/lcd
export HOME
case "$1" in
start)
echo "Starting temp reporting daemon"
/home/pi/pytemp.py 2>&1 &
# /home/pi/detec.py 2>&1 &
# /home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD/Adafruit_CharLCD_IPtemp.py 2>&1 &
;;
stop)
echo "Stopping LCD"
LCD_PID=`ps auxwww | grep pytemp.py | head -1 | awk '{print $2}'`
# LCD_PID2=`ps auxwww | grep detec.py | head -1 | awk '{print $2}'`
# LCD_PID=`ps auxwww | grep Adafruit_CharLCD_IPtemp.py | head -1 | awk '{print $2}'`
kill -9 $LCD_PID
# kill -9 $LCD_PID2
;;
*)
echo "Usage: /etc/init.d/temp {start|stop}"
exit 1
;;
esac
exit 0