tools/init.slackware

Thu, 13 May 2021 13:49:04 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 13 May 2021 13:49:04 +0200
changeset 612
452f79a5ad71
child 614
389097dc665d
permissions
-rw-r--r--

Make sure the hostname doesn't contain the domain name. Added Slackare init and setup scripts.

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