tools/rc.slackware

Sat, 16 Mar 2024 11:06:16 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 16 Mar 2024 11:06:16 +0100
changeset 639
276ee5b61348
parent 633
tools/init.slackware@8b84e73af50e
permissions
-rw-r--r--

Init system for Slackware only

#!/bin/bash
#
# thermferm init script for Slackware.
#
# Copyright 2022-2024 Michiel Broek, the Netherlands.

# Source default settings:
if [ -r /etc/default/thermferm ]; then
  . /etc/default/thermferm
fi

PIDFILE=/run/thermferm.pid

case "$1" in
  start)
    echo -n "Starting Fermentation Controller: "
    if [ -f ${PIDFILE} ]; then
  	echo "already running."
    else
	${THERMFERM_BIN}
        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