tools/init.slackware

Mon, 13 Feb 2023 16:39:03 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 13 Feb 2023 16:39:03 +0100
changeset 631
660001882989
parent 614
389097dc665d
child 633
8b84e73af50e
permissions
-rw-r--r--

Version 0.9.12

#!/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