From fa0e9907ee467dd6d58d401637f51e8e1d97b0f2 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 13:06:11 -0700 Subject: [PATCH] Use full executable path. Move the `ps` information out of the loop to prevent log spam. --- run.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/run.sh b/run.sh index 4695f7a..62219d9 100755 --- a/run.sh +++ b/run.sh @@ -6,7 +6,12 @@ DIR="$(dirname -- "${BASH_SOURCE[0]}")" PROG="$(basename -- "${BASH_SOURCE[0]}")" -echo "$DIR/$PROG" + +# Ensure we are executing from this file's directory. +cd $DIR +DIR="`pwd`" +NAME="'$DIR/$PROG'" +echo $NAME ## Functions ## @@ -27,13 +32,15 @@ function log { echo -e "`date` - $message" } +log "Local process information:" +ps $$ function check_main { if [[ -z "$1" ]]; then echo "ERROR: Subprocess name was not provided. $1" exit 0 fi log "Subprocess '$1' checking if main process is still running..." - ps $$ + ps $$ >/dev/null status=$? if [[ $status != 0 ]]; then log "Process '$$' not found, '$1' from '$DIR/$PROG' exiting." @@ -62,9 +69,6 @@ fi ## Build Environment ## -# Ensure we are executing from this file's directory. -cd $DIR - sudo="" if [[ -z $LOGNAME ]]; then LOGNAME="`whoami`"