summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-02-26 21:35:29 +0100
committerErich Eckner <git@eckner.net>2022-02-26 21:35:29 +0100
commit9cd16b34658518b670407b832ec152250d1d5a46 (patch)
treeaebd49122ce76b1cc5db405dc7e4ba975c14f574
parent28c089933e910065b8a332b786d111d2b9646545 (diff)
downloadshutdownasap-9cd16b34658518b670407b832ec152250d1d5a46.tar.xz
shutdownasap: use /proc/$pid instead of kill -0 $pid
-rwxr-xr-xshutdownasap.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/shutdownasap.in b/shutdownasap.in
index 3f2b90b..ba092f6 100755
--- a/shutdownasap.in
+++ b/shutdownasap.in
@@ -28,7 +28,7 @@ while [ $# -gt 0 ]; do
if [ -r "${tmpDir}/intention" ] \
&& grep -qxF 'shutdown' "${tmpDir}/intention" \
&& [ -r "${tmpDir}/pid" ] \
- && kill -0 "$(cat "${tmpDir}/pid")"; then
+ && [ -d "/proc/$(cat "${tmpDir}/pid")" ]; then
exit
fi
echo 'reboot' >"${tmpDir}/intention"