+magicWriteVersion() {
+ # Desc: Appends time-stamped VERSION to PATHOUT_TAR
+ # Usage: magicWriteVersion
+ # Version: 0.1.0
+ # Input: CONTENT_VERSION, FILEOUT_VERSION, PATHOUT_TAR, DIR_TMP
+ # Input: SCRIPT_VERSION, SCRIPT_URL, AGE_VERSION, AGE_URL, SCRIPT_HOSTNAME
+ # Output: appends tar PATHOUT_TAR
+ # Depends: dateTimeShort, appendArgTar
+ local CONTENT_VERSION pubKeyIndex
+
+ # Set VERSION file name
+ FILEOUT_VERSION="$(dateTimeShort)..VERSION";
+
+ # Gather VERSION data in CONTENT_VERSION
+ CONTENT_VERSION="SCRIPT_VERSION=$SCRIPT_VERSION";
+ #CONTENT_VERSION="$CONTENT_VERSION""\\n";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""SCRIPT_NAME=$SCRIPT_NAME";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""SCRIPT_URL=$SCRIPT_URL";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""AGE_VERSION=$AGE_VERSION";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""AGE_URL=$AGE_URL";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""DATE=$(date --iso-8601=seconds)";
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""HOSTNAME=$SCRIPT_HOSTNAME";
+ ## Add list of recipient pubkeys
+ for pubkey in "${recPubKeysValid[@]}"; do
+ ((pubKeyIndex++))
+ CONTENT_VERSION="$CONTENT_VERSION""\\n""PUBKEY_$pubKeyIndex=$pubkey";
+ done
+ ## Process newline escapes
+ CONTENT_VERSION="$(echo -e "$CONTENT_VERSION")"
+
+ # Write CONTENT_VERSION 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()