diff options
-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 |