## Default directory where to store temporary run files
if[ -w /tmp ];then
RUN_DIR=/tmp
elif[ -w /var/tmp ];then
@ -92,6 +93,12 @@ else
RUN_DIR=.
fi
## Special note when remote target is on the same host as initiator (happens for unit tests): we'll have to differentiate RUN_DIR so remote CleanUp won't affect initiator.
if["$_REMOTE_EXECUTION"==true];then
mkdir -p "$RUN_DIR/$PROGRAM.remote"
RUN_DIR="$RUN_DIR/$PROGRAM.remote"
fi
# Get a random number on Windows BusyBox alike, also works on most Unixes that have dd, if dd is not found, then return $RANDOM
function PoorMansRandomGenerator {
localdigits="${1}"# The number of digits to generate
@ -180,6 +187,8 @@ function RemoteLogger {
locallevel="${2}"# Log level
localretval="${3:-undef}"# optional return value of command
local prefix
if["$_LOGGER_PREFIX"=="time"];then
prefix="TIME: $SECONDS - "
elif["$_LOGGER_PREFIX"=="date"];then
@ -251,6 +260,8 @@ function Logger {
locallevel="${2}"# Log level
localretval="${3:-undef}"# optional return value of command