From 632fbcb4d0d23136e30eb3cbf36394fcf05b10ed Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 15 May 2018 16:01:36 +0200 Subject: [PATCH] Replace kill with ps in process existence check kill returns the same status whether a process doesn't exist or the current user doesn't have permission to kill, so the script returned a confusing error message in the latter case. --- kill-wpull-connections | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kill-wpull-connections b/kill-wpull-connections index 1496b81..e108435 100755 --- a/kill-wpull-connections +++ b/kill-wpull-connections @@ -42,7 +42,7 @@ then exit 1 fi -if ! kill -0 ${wpullPid} >/dev/null 2>&1 +if ! ps -p ${wpullPid} >/dev/null 2>&1 then echo "Error: no process with PID ${wpullPid}" exit 1