tools/init.slackware

changeset 612
452f79a5ad71
child 614
389097dc665d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/init.slackware	Thu May 13 13:49:04 2021 +0200
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# thermferm init script for Slackware.
+#
+# Copyright 2021 Michiel Broek, the Netherlands.
+
+PIDFILE=/var/run/thermferm.pid
+
+case "$1" in
+  start)
+    echo -n "Starting Fermentation Controller: "
+    if [ -f ${PIDFILE} ]; then
+  	echo "already running."
+    else
+	/usr/local/bin/thermferm
+        echo "done."
+    fi
+    ;;
+
+  stop)
+    echo -n "Stopping Fermentation Controller: "
+    if [ -f ${PIDFILE} ]; then
+      kill $(cat ${PIDFILE})
+      echo "done."
+    else
+      echo "wasn't running."
+    fi
+    ;;
+
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+

mercurial