Fetching current Domoticz revision number

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
Aurum
Posts: 2
Joined: Tuesday 05 February 2019 13:10
Target OS: -
Domoticz version:
Contact:

Fetching current Domoticz revision number

Post 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 :)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Fetching current Domoticz revision number

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Aurum
Posts: 2
Joined: Tuesday 05 February 2019 13:10
Target OS: -
Domoticz version:
Contact:

Re: Fetching current Domoticz revision number

Post by Aurum »

Not elegant, truly :)
I'll try that, thank you !
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests