|
1 #!/bin/bash |
|
2 # |
|
3 # thermferm init script for Slackware. |
|
4 # |
|
5 # Copyright 2021 Michiel Broek, the Netherlands. |
|
6 |
|
7 PIDFILE=/var/run/thermferm.pid |
|
8 |
|
9 case "$1" in |
|
10 start) |
|
11 echo -n "Starting Fermentation Controller: " |
|
12 if [ -f ${PIDFILE} ]; then |
|
13 echo "already running." |
|
14 else |
|
15 /usr/local/bin/thermferm |
|
16 echo "done." |
|
17 fi |
|
18 ;; |
|
19 |
|
20 stop) |
|
21 echo -n "Stopping Fermentation Controller: " |
|
22 if [ -f ${PIDFILE} ]; then |
|
23 kill $(cat ${PIDFILE}) |
|
24 echo "done." |
|
25 else |
|
26 echo "wasn't running." |
|
27 fi |
|
28 ;; |
|
29 |
|
30 restart) |
|
31 $0 stop |
|
32 sleep 1 |
|
33 $0 start |
|
34 ;; |
|
35 |
|
36 *) |
|
37 echo "usage: $0 {start|stop|restart}" |
|
38 esac |
|
39 |