11#! /usr/bin/env bash
22
33# version - MUST be exactly 7 characters!
4- UPDATE=" 2025v01 "
4+ UPDATE=" 2026v01 "
55
66# ----------------------------------------------------------------------
77# The intention of this script is that it should be able to be run
@@ -14,6 +14,9 @@ UPDATE="2025v01"
1414# overuse of sudo is a very common problem among new IOTstack users
1515[ " $EUID " -eq 0 ] && echo " This script should NOT be run using sudo" && exit 1
1616
17+ # the name of this script is
18+ SCRIPT=$( basename " ${0} " )
19+
1720# where is this script is running?
1821WHERE=$( dirname " $( realpath " $0 " ) " )
1922
@@ -47,7 +50,7 @@ COMPOSE_SYMLINK_PATH="/usr/local/bin/docker-compose"
4750CMDLINE_OPTIONS=" cgroup_memory=1 cgroup_enable=memory"
4851
4952# dependencies installed via apt
50- APT_DEPENDENCIES=" curl git jq pwgen python3-pip python3-dev python3-virtualenv uuid-runtime whiptail"
53+ APT_DEPENDENCIES=" curl git jq pwgen python3-pip python3-dev python3-virtualenv rsync sqlite3 uuid-runtime whiptail"
5154
5255# minimum version requirements
5356DOCKER_VERSION_MINIMUM=" 24"
@@ -72,11 +75,12 @@ LOGOUT_REQUIRED=false
7275# Returns:
7376# JSON string with version, commit ID and exit code
7477# Note:
75- # If $0 is not under Git control (eg a zip download of IOTstack) then
76- # the commit field will be an empty string.
78+ # If $SCRIPT is not under Git control (eg a zip download of IOTstack)
79+ # then the commit field will be an empty string.
7780#
7881version_json () {
79- echo " {\" version\" : \" ${UPDATE} \" , \" commit\" : \" $( git log -n 1 --pretty=format:%H -- " ${0} " 2> /dev/null) \" , \" exitCode\" : ${1} }"
82+ local commitID=$( git -C " ${IOTSTACK} " log -n 1 --pretty=format:%H -- " ${SCRIPT} " 2> /dev/null)
83+ echo " {\" version\" : \" ${UPDATE} \" , \" commit\" : \" ${commitID} \" , \" exitCode\" : ${1} }"
8084}
8185
8286
0 commit comments