tools/init.slackware

Mon, 08 Aug 2022 19:39:37 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 08 Aug 2022 19:39:37 +0200
changeset 622
d34ff166e07b
parent 614
389097dc665d
child 633
8b84e73af50e
permissions
-rw-r--r--

Merged again

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