Sun, 10 Jul 2022 14:33:13 +0200
Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
612
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | #!/bin/bash |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | # |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | # thermferm init script for Slackware. |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | # |
614
389097dc665d
Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents:
612
diff
changeset
|
5 | # Copyright 2022 Michiel Broek, the Netherlands. |
612
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | PIDFILE=/var/run/thermferm.pid |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | case "$1" in |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | start) |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | echo -n "Starting Fermentation Controller: " |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | if [ -f ${PIDFILE} ]; then |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | echo "already running." |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | else |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | /usr/local/bin/thermferm |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | echo "done." |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | fi |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | ;; |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | stop) |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | echo -n "Stopping Fermentation Controller: " |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | if [ -f ${PIDFILE} ]; then |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | kill $(cat ${PIDFILE}) |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | echo "done." |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | else |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | echo "wasn't running." |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | fi |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | ;; |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | restart) |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | $0 stop |
614
389097dc665d
Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents:
612
diff
changeset
|
32 | sleep 2 |
612
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | $0 start |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | ;; |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | *) |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | echo "usage: $0 {start|stop|restart}" |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | esac |
452f79a5ad71
Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 |