document the change in prompt timeout handling
[vlock.git] / scripts / hibernate.sh
blobb3ba4c83c7007e7d6b9224c468c4ef5d1ce35f0a
1 #!/bin/sh
2 # hibernate.sh -- hibernate script for vlock,
3 # the VT locking program for linux
4 #
5 # This program is copyright (C) 2007 Frank Benkstein, and is free software. It
6 # comes without any warranty, to the extent permitted by applicable law. You
7 # can redistribute it and/or modify it under the terms of the Do What The Fuck
8 # You Want To Public License, Version 2, as published by Sam Hocevar. See
9 # http://sam.zoy.org/wtfpl/COPYING for more details.
11 set -e
13 REQUIRES="all"
14 CONFLICTS="new"
15 PRECEEDS="all"
17 hooks() {
18 oldvt=$(fgconsole)
20 while read hook_name ; do
21 case "${hook_name}" in
22 vlock_start)
23 chvt 63
25 vlock_end)
26 chvt "${oldvt}"
28 vlock_save)
29 hibernate
31 esac
32 done
35 if [ $# -ne 1 ] ; then
36 echo >&2 "Usage: $0 <command>"
37 exit 1
40 case "$1" in
41 hooks)
42 hooks
44 preceeds)
45 echo "${PRECEEDS}"
47 succeeds)
48 echo "${SUCCEEDS}"
50 requires)
51 echo "${REQUIRES}"
53 needs)
54 echo "${NEEDS}"
56 depends)
57 echo "${DEPENDS}"
59 conflicts)
60 echo "${CONFLICTS}"
63 echo >&2 "$0: unknown command '$1'"
64 exit 1
66 esac