tools/init.slackware

Sun, 10 Jul 2022 14:33:13 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 10 Jul 2022 14:33:13 +0200
changeset 614
389097dc665d
parent 612
452f79a5ad71
child 633
8b84e73af50e
permissions
-rw-r--r--

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.

#!/bin/bash
#
# thermferm init script for Slackware.
#
# Copyright 2022 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 2
    $0 start
    ;;

  *)
    echo "usage: $0 {start|stop|restart}"
esac

mercurial