From 99647c9a09286c7bc6db6e816c38d4f542be1a41 Mon Sep 17 00:00:00 2001 From: Louwrentius Date: Sat, 10 Jan 2009 12:46:01 +0000 Subject: [PATCH] Fixed errors when no log file is specified --- trunk/ppss.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trunk/ppss.sh b/trunk/ppss.sh index 0c12511..ddb32aa 100755 --- a/trunk/ppss.sh +++ b/trunk/ppss.sh @@ -39,13 +39,14 @@ trap 'kill_process; ' INT # Setting some vars. Do not change. SCRIPT_NAME="Parallel Processing Shell Script" -SCRIPT_VERSION="1.04" +SCRIPT_VERSION="1.05" RUNNING_SIGNAL="$0_is_running" GLOBAL_LOCK="PPSS-$RANDOM-$RANDOM" PAUSE_SIGNAL="pause.txt" ARRAY_POINTER_FILE="array-pointer-$RANDOM-$RANDOM" JOB_LOG_DIR="job_log" +LOGFILE="ppss-log.txt" MAX_DELAY=2 PERCENT="0" PID="$$" @@ -145,6 +146,7 @@ is_running () { fi } +# If no arguments are specified, show usage. if [ $# -eq 0 ] then showusage @@ -218,6 +220,12 @@ do esac done +# Init log file +if [ -e "$LOGFILE" ] +then + rm $LOGFILE +fi + init_vars () { echo 0 > "$ARRAY_POINTER_FILE"