# Record gps data until script lifespan ends
declare debugCounter; debugCounter="0"; # set debug counter
- timeStart=$(dateTimeShort); # Note start time
while [[ "$SECONDS" -lt "$scriptTTL" ]]; do
+ timeBufferStart="$(dateTimeShort)"; # Note start time
# Determine file paths (time is start of buffer period)
- FILEOUT_BASENAME="$timeStart""--""$bufferTTL_STR""..""$SCRIPT_HOSTNAME""_location" && vbm "STATUS:Set FILEOUT_BASENAME to:$FILEOUT_BASENAME";
+ FILEOUT_BASENAME="$timeBufferStart""--""$bufferTTL_STR""..""$SCRIPT_HOSTNAME""_location" && vbm "STATUS:Set FILEOUT_BASENAME to:$FILEOUT_BASENAME";
## Files saved to DIR_TMP
PATHOUT_NMEA="$DIR_TMP"/"$FILEOUT_BASENAME".nmea"$CMD_COMPRESS_SUFFIX""$CMD_ENCRYPT_SUFFIX" && vbm "STATUS:Set PATHOUT_NMEA to:$PATHOUT_NMEA";
PATHOUT_GPX="$DIR_TMP"/"$FILEOUT_BASENAME".gpx"$CMD_COMPRESS_SUFFIX""$CMD_ENCRYPT_SUFFIX" && vbm "STATUS:Set PATHOUT_GPX to:$PATHOUT_GPX";
# Remove secured chunks from DIR_TMP
try rm "$PATHOUT_NMEA" "$PATHOUT_GPX" "$PATHOUT_KML";
# Reset buffer and filenames
- unset bufferBash FILEOUT_BASENAME PATHOUT_NMEA PATHOUT_GPX PATHOUT_KML PATHOUT_TAR;
+ unset bufferBash FILEOUT_BASENAME PATHOUT_NMEA PATHOUT_GPX PATHOUT_KML PATHOUT_TAR timeBufferStart;
vbm "DEBUG:Completed buffer session $debugCounter ." 1>&2;
((debugCounter++))
done
# Remove DIR_TMP
try rm -r "$DIR_TMP";
+
+ vbm "STATUS:Main function finished."
} # Main function.
#===END Declare local script functions===
#==END Define script parameters==