From: Steven Baltakatei Sandoval Date: Thu, 2 Jul 2020 20:51:06 +0000 (+0000) Subject: feat(bkgpslog):Change format in VERSION file X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/4c0c58507580fef5596125bd4b0c10cfad9cca53?ds=inline;hp=3df184eb452e1c7034697db5435d49c812f8b40b feat(bkgpslog):Change format in VERSION file From one line to multiline --- diff --git a/exec/bkgpslog b/exec/bkgpslog index 19f95f2..562e529 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -15,6 +15,7 @@ SCRIPT_TIME_START=$(date +%Y%m%dT%H%M%S.%N); PATH="$HOME/.local/bin:$PATH"; # Add "$(systemd-path user-binaries)" path in case apps saved there SCRIPT_HOSTNAME=$(hostname); # Save hostname of system running this script. SCRIPT_VERSION="bkgpslog 0.2.0"; # Define version of script. +SCRIPT_NAME="$(basename "$0")"; # Define basename of script file. declare -Ag appRollCall # Associative array for storing app status declare -Ag fileRollCall # Associative array for storing file status @@ -714,10 +715,16 @@ magicWriteVersion() { # Usage: magicWriteVersion # Input: CONTENT_VERSION, FILEOUT_VERSION, PATHOUT_TAR, DIR_TMP # Depends: dateTimeShort, appendArgTar + local CONTENT_VERSION # Generate VERSION file in BashVar FILEOUT_VERSION="$(dateTimeShort)..VERSION"; - CONTENT_VERSION="$(dateTimeShort):$(basename "$0")"" Version:""$SCRIPT_VERSION"; + CONTENT_VERSION="VERSION=$SCRIPT_VERSION"; + CONTENT_VERSION="$CONTENT_VERSION""\n""SCRIPT_NAME=SCRIPT_NAME"; + CONTENT_VERSION="$CONTENT_VERSION""\n""DATE=$(date --iso-8601=seconds)"; + CONTENT_VERSION="$CONTENT_VERSION""\n""HOSTNAME=$SCRIPT_HOSTNAME"; + CONTENT_VERSION="$(echo -e "$CONTENT_VERSION")" + # Create BashVar as file FILEOUT_VERSION and write-append to PATHOUT_TAR appendArgTar "$CONTENT_VERSION" "$FILEOUT_VERSION" "$PATHOUT_TAR" "$DIR_TMP"; } # bkgpslog: write version data to PATHOUT_TAR via appendArgTar()