refactoring

This commit is contained in:
Patrick Schleizer 2025-04-19 12:45:06 -04:00
parent 5a37790e6b
commit 96ff7c8dc6
No known key found for this signature in database
GPG key ID: CB8D50BB77BB3C48

View file

@ -21,12 +21,9 @@ sigterm_trap() {
if [ "$lastpid" = "" ]; then if [ "$lastpid" = "" ]; then
exit 143 exit 143
fi fi
ps -p "$lastpid" >/dev/null 2>&1 if kill -0 -- "$lastpid" &>/dev/null ; then
if [ ! "$?" = "0" ]; then kill -s sigterm -- "$lastpid"
## Already terminated.
exit 143
fi fi
kill -s sigterm "$lastpid"
exit 143 exit 143
} }