From ab408ce653d984a581e743addc9b0dec8f5ec247 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 14 May 2020 17:48:11 -0400 Subject: [PATCH] bin: Put log parameter handling logic together --- bin/safeRun.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/safeRun.sh b/bin/safeRun.sh index 038d9f5ea..918f13cc2 100755 --- a/bin/safeRun.sh +++ b/bin/safeRun.sh @@ -22,15 +22,15 @@ error() { log "ERROR: $@" >&2; } fatal() { error "$@"; exit 1; } LAST_EMAIL_SEND=0 -LOG="$1" # Move to the folder where ep-lite is installed cd "$(dirname "$0")"/.. # Check if a logfile parameter is set +LOG="$1" [ -n "${LOG}" ] || fatal "Set a logfile as the first parameter" - shift + while true; do # Try to touch the file if it doesn't exist [ -f "${LOG}" ] || touch "${LOG}" || fatal "Logfile '${LOG}' is not writeable"