diff options
author | Charadon <charadon@charadon-gmpc.hsd1.ga.comcast.net> | 2022-07-14 01:40:00 -0400 |
---|---|---|
committer | Charadon <charadon@charadon-gmpc.hsd1.ga.comcast.net> | 2022-07-14 01:40:00 -0400 |
commit | dc9b88d10505c72d1559b1a65a86d3026fb6e334 (patch) | |
tree | 5d567fe6c11d8f0fc699fc86f3342e81087bfa39 | |
parent | 905c436f2b1e0c74a2d858bf09b320f54292b251 (diff) | |
download | dscip-dc9b88d10505c72d1559b1a65a86d3026fb6e334.tar.gz |
Fixed PID detection
-rwxr-xr-x | dscip | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dscip b/dscip index c35ae3b..9621800 100755 --- a/dscip +++ b/dscip @@ -27,7 +27,7 @@ DSCIP_GITREPO="https://www.example.com/example/example.git" DSCIP_GITMODE="clone" # Branch to check # DSCIP_BRANCH="master" -WORKING_DIRECTORY="/tmp/example" +WORKING_DIRECTORY="." # Commands to run before building. # DSCIP_PRE_CMD="$WORKING_DIRECTORY/pre.sh" # Commands to run to build program. # @@ -47,7 +47,8 @@ DSCIP_DISREGARD_COMMIT_CHECK="false" # If the script should just rebuild even # # Check if script is currently running, and if not, reset LOCK # if [ -f $WORKING_DIRECTORY/LOCK ]; then LOCKED_PID=$(cat $WORKING_DIRECTORY/LOCK) - if ps -p $LOCKED_PID; then + if ps -U $USER -p "$LOCKED_PID"; then + echo "Script still running. Exiting..." exit 0 else rm $WORKING_DIRECTORY/LOCK |