Page 1 of 1

Fetching current Domoticz revision number

Posted: Tuesday 05 February 2019 13:21
by Aurum
Hello !

Domoticz user since 2016, I have it running in a Docker container on a RPi.
Nothing too fancy, but I'm planning on bringing a little more automation in the process, and with that in mind, I'd like to build my Docker images with the revision as the tag.

I know that I can get the revision from the json found at json.htm?type=command&param=checkforupdate, but is there a way to fetch the current revision number elsewhere, like if my domoticz isn't running anymore ?

Many thanks in advance for the answers :)

Re: Fetching current Domoticz revision number

Posted: Tuesday 05 February 2019 15:13
by waaren
Aurum wrote: Tuesday 05 February 2019 13:21 Hello !

Domoticz user since 2016, I have it running in a Docker container on a RPi.
Nothing too fancy, but I'm planning on bringing a little more automation in the process, and with that in mind, I'd like to build my Docker images with the revision as the tag.

I know that I can get the revision from the json found at json.htm?type=command&param=checkforupdate, but is there a way to fetch the current revision number elsewhere, like if my domoticz isn't running anymore ?

Many thanks in advance for the answers :)
Not a very elegant way but it works

Code: Select all

#!/bin/sh

# This script can be used get current revison

lowercase(){
    echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}

OS=`lowercase \`uname -s\``
MACH=`uname -m`
if [ ${MACH} = "armv6l" ]
then
 MACH="armv7l"
fi

#echo "Downloading tgz"
#echo "Please Standby..."
mkdir tempDomoticz
cd tempDomoticz
wget -q -O domoticz_beta.tgz --no-check-certificate "https://www.domoticz.com/download.php?channel=beta&type=release&system=${OS}&machine=${MACH}"
tar xfz domoticz_beta.tgz domoticz
rm domoticz_beta.tgz
./domoticz --version | grep Giz
newDomoticzVersion=$(./domoticz --version 2> /dev/null | grep Giz | awk -F "Domoticz V" {'print substr($2,0,7)'})
echo $newDomoticzVersion
cd ..
rm -r tempDomoticz

Re: Fetching current Domoticz revision number

Posted: Wednesday 06 February 2019 13:27
by Aurum
Not elegant, truly :)
I'll try that, thank you !