Fixed errors when no log file is specified
This commit is contained in:
parent
0e9885a1c8
commit
630d566068
10
ppss.sh
10
ppss.sh
@ -39,13 +39,14 @@ trap 'kill_process; ' INT
|
|||||||
|
|
||||||
# Setting some vars. Do not change.
|
# Setting some vars. Do not change.
|
||||||
SCRIPT_NAME="Parallel Processing Shell Script"
|
SCRIPT_NAME="Parallel Processing Shell Script"
|
||||||
SCRIPT_VERSION="1.04"
|
SCRIPT_VERSION="1.05"
|
||||||
|
|
||||||
RUNNING_SIGNAL="$0_is_running"
|
RUNNING_SIGNAL="$0_is_running"
|
||||||
GLOBAL_LOCK="PPSS-$RANDOM-$RANDOM"
|
GLOBAL_LOCK="PPSS-$RANDOM-$RANDOM"
|
||||||
PAUSE_SIGNAL="pause.txt"
|
PAUSE_SIGNAL="pause.txt"
|
||||||
ARRAY_POINTER_FILE="array-pointer-$RANDOM-$RANDOM"
|
ARRAY_POINTER_FILE="array-pointer-$RANDOM-$RANDOM"
|
||||||
JOB_LOG_DIR="job_log"
|
JOB_LOG_DIR="job_log"
|
||||||
|
LOGFILE="ppss-log.txt"
|
||||||
MAX_DELAY=2
|
MAX_DELAY=2
|
||||||
PERCENT="0"
|
PERCENT="0"
|
||||||
PID="$$"
|
PID="$$"
|
||||||
@ -145,6 +146,7 @@ is_running () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If no arguments are specified, show usage.
|
||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
showusage
|
showusage
|
||||||
@ -218,6 +220,12 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Init log file
|
||||||
|
if [ -e "$LOGFILE" ]
|
||||||
|
then
|
||||||
|
rm $LOGFILE
|
||||||
|
fi
|
||||||
|
|
||||||
init_vars () {
|
init_vars () {
|
||||||
|
|
||||||
echo 0 > "$ARRAY_POINTER_FILE"
|
echo 0 > "$ARRAY_POINTER_FILE"
|
||||||
|
Loading…
Reference in New Issue
Block a user