tools/init.slackware

Tue, 31 Aug 2021 20:48:37 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 31 Aug 2021 20:48:37 +0200
changeset 774
92e1e8f175a2
parent 746
44d929ff268e
permissions
-rw-r--r--

Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.

#!/bin/bash
#
# bmsd init script for Slackware.
#
# Copyright 2021 Michiel Broek, the Netherlands.


case "$1" in
  start)
    echo -n "Starting Brewery Management System: "
    if [ -f /var/lib/bms/.bms/bms.config ]; then
      if [ -f /var/lib/bms/.bms/run/bmsd.pid ]; then
  	echo "already running."
      else
	/var/lib/bms/bin/bmsd
	sleep 1
        echo "done."
      fi
    else
      echo "not configured."
    fi
    ;;

  stop)
    echo -n "Stopping Brewery Management System: "
    if [ -f /var/lib/bms/.bms/run/bmsd.pid ]; then
      kill $(cat /var/lib/bms/.bms/run/bmsd.pid)
      sleep 3
      rm -f /var/lib/bms/.bms/run/bmsd.pid
      echo "done."
    else
      echo "wasn't running."
    fi
    ;;

  restart)
    $0 stop
    sleep 1
    $0 start
    ;;

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

mercurial