diff options
author | Erich Eckner <git@eckner.net> | 2022-03-06 07:20:49 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2022-03-06 07:20:49 +0100 |
commit | 594fc7ecfd3319250e463c51b78348f3ed62f6b0 (patch) | |
tree | 430b7eb898a1657ed37f36c78f37ab1f961b4f1e | |
parent | 4b02bfd863c1a818d7af082b2e1d8256aa816362 (diff) | |
download | shutdownasap-594fc7ecfd3319250e463c51b78348f3ed62f6b0.tar.xz |
shutdownasap.in: one shutdownasap per system is enough - we don't need to run one per user
-rwxr-xr-x | shutdownasap.in | 4 |
1 files changed, 3 insertions, 1 deletions
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" |