From 594fc7ecfd3319250e463c51b78348f3ed62f6b0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 6 Mar 2022 07:20:49 +0100 Subject: shutdownasap.in: one shutdownasap per system is enough - we don't need to run one per user --- shutdownasap.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shutdownasap.in b/shutdownasap.in index ba092f6..1cb8d4e 100755 --- a/shutdownasap.in +++ b/shutdownasap.in @@ -46,7 +46,9 @@ if ! ${intentionSet}; then echo 'shutdown' >"${tmpDir}/intention" fi -[ -r "${tmpDir}/pid" ] && kill -0 "$(cat "${tmpDir}/pid")" && exit +[ -r "${tmpDir}/pid" ] \ +&& [ -d "/proc/$(cat "${tmpDir}/pid")" ] \ +&& exit echo $$ > "${tmpDir}/pid" -- cgit v1.2.3-54-g00ecf