Wed, 01 May 2024 14:38:37 +0200
Added device_present() function to easy update device present from one-wire and simulator devices. When a simulator temperature sensor present is changed, the device table is changed too. Controlling simulator relays is now for each simulator. The simulator runs under the state machine. If something changed in the running simulator, all data is broadcasted over websocket. Completed the web editor.
#!/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 STOPTIME=45 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}) tim=0 while [ true ]; do [ ! -f "${PIDFILE}" ] && break; [ $tim -gt $STOPTIME ] && break; echo -n "." sleep 1 tim=$(($tim+1)) done echo "done." else echo "wasn't running." fi ;; restart) $0 stop sleep 2 $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac