fi
}
+# Get a tempfile, add it to the right variable to get rid of it,
+# and return it
+function gettempfile() {
+ local MAKEDIR=${1:-false}
+ local TMPARGS=""
+ if [[ ${MAKEDIR} == true ]]; then
+ TMPARGS="--directory"
+ fi
+ local TMPFILE=$( mktemp -p ${TMPDIR} ${TMPARGS} )
+ TMPFILES="${TEMPFILES} ${TMPFILE}"
+ echo "${TMPFILE}"
+}
+
# Function that only cleans tempfiles, but does not exit or otherwise
# care about any exit status
function cleantempfiles() {
# Now we should make sure that we have a usable ${PROGRAM}.log, so
# append the $STAGEFILE.log to it.
- /usr/bin/ts "%b %d %H:%M:%S ${HOSTNAME} ${PROGRAM}[$$]: ${FUNC} " < "${STAGEFILE}.log"
+ if [[ ${TIMESTAMP} == true ]]; then
+ /usr/bin/ts "%b %d %H:%M:%S ${HOSTNAME} ${PROGRAM}[$$]: ${FUNC} " < "${STAGEFILE}.log"
+ else
+ cat "${STAGEFILE}.log"
+ fi
rm -f "${STAGEFILE}.log"
log "########## ${PROGRAM} END: ${FUNC} ##########"