commit 6298255139ac499b4d0a4a192a73f8f938dc16a7
parent 0de9f94fad32f5a60ae56983b34f54ca3936a015
Author: Cem Keylan <cem@ckyln.com>
Date: Wed, 16 Sep 2020 16:49:45 +0300
checkprocess(): return if there is no pid given
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/sysmgr b/sysmgr
@@ -42,6 +42,9 @@ usage() {
}
checkprocess() {
+ # If no arguments are given, do not continue.
+ # This may happen when getpid returns empty.
+ [ "$1" ] || return 1
# This function checks if the process is still alive and returns 0 or 1
# accordingly. It checks the /proc directory first (which exists in most