# HG changeset patch # User Michiel Broek # Date 1549746751 -3600 # Node ID 62e294ab94f5c0e2e28e24f017f5cb49645a7035 # Parent 4767a790d1f647f05a7e20007e9506851e3600cb Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging diff -r 4767a790d1f6 -r 62e294ab94f5 config.status --- a/config.status Sat Feb 09 20:14:21 2019 +0100 +++ b/config.status Sat Feb 09 22:12:31 2019 +0100 @@ -621,9 +621,9 @@ S["CC"]="gcc" S["CYEARS"]="2016-2019" S["COPYRIGHT"]="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" -S["VERSION"]="0.0.5" +S["VERSION"]="0.0.6" S["PACKAGE"]="bms" -S["SUBDIRS"]="bmsd doc tools www" +S["SUBDIRS"]="bmsd doc script tools www" S["target_alias"]="" S["host_alias"]="" S["build_alias"]="" @@ -709,7 +709,7 @@ D["PACKAGE_STRING"]=" \"\"" D["PACKAGE_BUGREPORT"]=" \"\"" D["PACKAGE_URL"]=" \"\"" -D["VERSION"]=" \"0.0.5\"" +D["VERSION"]=" \"0.0.6\"" D["COPYRIGHT"]=" \"Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved\"" D["STDC_HEADERS"]=" 1" D["HAVE_SYS_TYPES_H"]=" 1" diff -r 4767a790d1f6 -r 62e294ab94f5 configure --- a/configure Sat Feb 09 20:14:21 2019 +0100 +++ b/configure Sat Feb 09 22:12:31 2019 +0100 @@ -2027,11 +2027,11 @@ ac_config_headers="$ac_config_headers config.h" -SUBDIRS="bmsd doc tools www" +SUBDIRS="bmsd doc script tools www" PACKAGE="bms" -VERSION="0.0.5" +VERSION="0.0.6" COPYRIGHT="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" CYEARS="2016-2019" diff -r 4767a790d1f6 -r 62e294ab94f5 configure.ac --- a/configure.ac Sat Feb 09 20:14:21 2019 +0100 +++ b/configure.ac Sat Feb 09 22:12:31 2019 +0100 @@ -2,13 +2,13 @@ AC_INIT(bmsd/bms.c) AM_CONFIG_HEADER(config.h) -SUBDIRS="bmsd doc tools www" +SUBDIRS="bmsd doc script tools www" AC_SUBST(SUBDIRS) dnl General settings dnl After changeing the version number, run autoconf! PACKAGE="bms" -VERSION="0.0.5" +VERSION="0.0.6" COPYRIGHT="Copyright (C) 2016-2019 Michiel Broek, All Rights Reserved" CYEARS="2016-2019" AC_SUBST(PACKAGE) diff -r 4767a790d1f6 -r 62e294ab94f5 script/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script/Makefile Sat Feb 09 22:12:31 2019 +0100 @@ -0,0 +1,25 @@ +# Makefile for the mbsePi-apps/thermferm. + +include ../Makefile.global + +TARGET = bmsd +OTHER = Makefile crontask + +############################################################################# + +.c.o: + ${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $< + +all: + + +clean: + +install: + ${INSTALL} -d -g 314 -o 314 ${PREFIX} ${BINDIR} + ${INSTALL} -c -g 314 -o 314 -m 0755 crontask ${BINDIR} + +filelist: Makefile + BASE=`pwd`; \ + BASE=`basename $${BASE}`; \ + (for f in ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist diff -r 4767a790d1f6 -r 62e294ab94f5 script/crontask --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script/crontask Sat Feb 09 22:12:31 2019 +0100 @@ -0,0 +1,5 @@ +#!/bin/sh + +cd $HOME/www +php crontasks.php + diff -r 4767a790d1f6 -r 62e294ab94f5 www/Makefile --- a/www/Makefile Sat Feb 09 20:14:21 2019 +0100 +++ b/www/Makefile Sat Feb 09 22:12:31 2019 +0100 @@ -3,7 +3,8 @@ include ../Makefile.global -SRC = cmd_fermenter.php config.php.dist favicon.ico gen_about.php getfermentablesources.php \ +SRC = cmd_fermenter.php config.php.dist crontasks.php favicon.ico gen_about.php \ + getfermentablesources.php \ getfermenter.php getfermentlog.php gethopsources.php getmiscsources.php \ getnode.php getwatersources.php getyeastsources.php index.php \ inv_equipments.php inv_fermentables.php inv_hops.php inv_instock.php \ diff -r 4767a790d1f6 -r 62e294ab94f5 www/crontasks.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/crontasks.php Sat Feb 09 22:12:31 2019 +0100 @@ -0,0 +1,14 @@ + 0"; +$result = $mysqli->query($query); + +$query = "UPDATE products SET stage=8 WHERE stage = 7 AND DATEDIFF(CURDATE(), package_date) > 13"; +$result = $mysqli->query($query); + +$query = "UPDATE products SET stage=9 WHERE stage = 8 AND DATEDIFF(CURDATE(), package_date) > 41"; +$result = $mysqli->query($query); +