From 7c9da647b5ba9522a16ce010f2ad53068020c127 Mon Sep 17 00:00:00 2001 From: Louwrentius Date: Wed, 14 Apr 2010 21:22:04 +0000 Subject: [PATCH] Backup, added break after mode check, some cleanups --- ppss | 21 ++++++++++++--------- ppss-test.sh | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ppss b/ppss index 09b5bc6..b06d986 100755 --- a/ppss +++ b/ppss @@ -35,6 +35,7 @@ do then MODE="$1" shift + break fi done @@ -796,7 +797,7 @@ init_vars () { if [ -e "$CPUINFO" ] then - CPU=`cat /proc/cpuinfo | grep 'model name' | cut -d ":" -f 2 | sed -e s/^\ //g | sort | uniq` + CPU=`cat $CPUINFO | grep 'model name' | cut -d ":" -f 2 | sed -e s/^\ //g | sort | uniq` log DSPLY "CPU: $CPU" elif [ "$ARCH" == "Darwin" ] then @@ -806,7 +807,6 @@ init_vars () { elif [ "$ARCH" == "SunOS" ] then CPU=`psrinfo -v | grep MHz | cut -d " " -f 4,8 | awk '{ printf ("Processor architecture: %s @ %s MHz.\n", $1,$2) }' | head -n 1` - log DSPLY "$CPU" else log DSPLY "CPU: Cannot determine. Provide a patch for your arch!" @@ -819,21 +819,21 @@ init_vars () { fi does_file_exist "$PPSS_HOME_DIR" - if [ ! "$?" == "0" ] && [ ! -z "$SSH_SERVER" ] + if [ ! "$?" == "0" ] then log DEBUG "Remote PPSS home directory $PPSS_HOME_DIR does not exist. Creating." exec_cmd "mkdir -p $PPSS_HOME_DIR/$PPSS_DIR" fi does_file_exist "$PPSS_HOME_DIR/$JOB_LOG_DIR" - if [ ! "$?" == "0" ] && [ ! -z "$SSH_SERVER" ] + if [ ! "$?" == "0" ] then log DEBUG "Remote Job log directory $JOB_lOG_DIR does not exist. Creating." exec_cmd "mkdir $PPSS_HOME_DIR/$JOB_LOG_DIR" fi does_file_exist "$ITEM_LOCK_DIR" - if [ ! "$?" == "0" ] && [ ! -z "$SSH_SERVER" ] + if [ ! "$?" == "0" ] then log DEBUG "Creating remote item lock dir." exec_cmd "mkdir $ITEM_LOCK_DIR" @@ -844,11 +844,14 @@ init_vars () { mkdir -p "$JOB_LOG_DIR" fi - does_file_exist "$REMOTE_OUTPUT_DIR" - if [ ! "$?" == "0" ] && [ ! -z "$SSH_SERVER" ] + if [ ! -z "$SSH_SERVER" ] then - log DEBUG "Remote output dir $REMOTE_OUTPUT_DIR does not exist." - exec_cmd "mkdir $REMOTE_OUTPUT_DIR" + does_file_exist "$REMOTE_OUTPUT_DIR" + if [ ! "$?" == "0" ] + then + log DEBUG "Remote output dir $REMOTE_OUTPUT_DIR does not exist." + exec_cmd "mkdir $REMOTE_OUTPUT_DIR" + fi fi if [ ! -e "$PPSS_LOCAL_TMPDIR" ] diff --git a/ppss-test.sh b/ppss-test.sh index d386435..1e27964 100755 --- a/ppss-test.sh +++ b/ppss-test.sh @@ -1,7 +1,7 @@ #!/bin/bash DEBUG="$1" -VERSION="2.62" +VERSION="2.63" TMP_DIR="ppss" PPSS=./ppss PPSS_DIR=ppss_dir