From ce45e69774828b3a24f786dbd7b47af2389938f2 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 19 Mar 2017 21:21:08 +0100 Subject: [PATCH] added config check --- contrib/updatecheck/calcversions.sh | 7 ++++--- contrib/updatecheck/index.php | 30 +++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/contrib/updatecheck/calcversions.sh b/contrib/updatecheck/calcversions.sh index cf22c172..da502b97 100755 --- a/contrib/updatecheck/calcversions.sh +++ b/contrib/updatecheck/calcversions.sh @@ -1,5 +1,6 @@ #!/bin/sh -version=`head -n 1 VERSION` +version=`head -n 1 ../../VERSION` revision=`git describe --always` -echo "ebusd=${version}.${revision}" > versions.txt -#TODO add calculation for config files +echo "ebusd=${version},${revision}" > versions.txt +files=`find config/ -type f -or -type l` +../../src/lib/ebus/test/test_filereader $files|sed -e 's#^config/##' -e 's#^\([^ ]*\) #\1=#' -e 's# #,#g'|sort >> versions.txt diff --git a/contrib/updatecheck/index.php b/contrib/updatecheck/index.php index 67f127c4..3be24e92 100644 --- a/contrib/updatecheck/index.php +++ b/contrib/updatecheck/index.php @@ -1,8 +1,6 @@ $val['t']; + if ($newer || $v[0]!=$val['h'] || $v[1]!=$val['s']) { + if ($newer) $neweravail++; + $configs .= ', '.$k.': '.($newer?'newer':'different').' version available'; + } + } + }; + array_walk($r['l'], $func); + if (strlen($configs)>100) { + $ret .= ($neweravail?$neweravail.', newer ':', different').' configuration files available'; + } else { + $ret .= $configs; + } } echo $ret; exit;