diff options
author | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2024-08-05 07:59:41 +0200 |
---|---|---|
committer | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2024-08-05 07:59:41 +0200 |
commit | d4f83e3fc5d06a52f1d8b869c0926fa34ec8fb95 (patch) | |
tree | 9cd13084535fe1ab9fa8b47c72f0a2666e570192 | |
parent | 17455526a3f62a458a130e25722f4eae1e717139 (diff) | |
download | shutdownasap-d4f83e3fc5d06a52f1d8b869c0926fa34ec8fb95.tar.xz |
shutdownasap: "-g" neu
-rwxr-xr-x | shutdownasap.in | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shutdownasap.in b/shutdownasap.in index 672e704..4b931fd 100755 --- a/shutdownasap.in +++ b/shutdownasap.in @@ -9,6 +9,14 @@ set -e mkdir -p "${tmpDir}" cd "${tmpDir}" +if [ $# -eq 1 ] && [ "x$1" = 'x-g' ]; then + [ -r "${tmpDir}/pid" ] \ + && [ -d "/proc/$(cat "${tmpDir}/pid")" ] \ + && cat "${tmpDir}/intention" \ + || echo 'none' + exit +fi + quiet=false intentionSet=false while [ $# -gt 0 ]; do @@ -36,6 +44,11 @@ while [ $# -gt 0 ]; do ;; *) >&2 echo 'usage: shutdownasap [-q] [-a|-r|-R]' + >&2 echo ' -a abort' + >&2 echo ' -g get intention' + >&2 echo ' -q quiet' + >&2 echo ' -r reboot' + >&2 echo ' -R reboot if not yet shutdown' exit 1 ;; esac |