Merge with git+ssh://toidinamai@repo.or.cz/srv/git/vlock.git
[vlock.git] / scripts / hibernate.sh
blobf35cbeb12d445753cb0f477fc1b2d5a86ecedc75
1 #!/bin/sh
3 set -e
5 hooks() {
6 oldvt=$(fgconsole)
8 while read hook_name ; do
9 case "${hook_name}" in
10 vlock_start)
11 chvt 63
13 vlock_end)
14 chvt "${oldvt}"
16 vlock_save)
17 hibernate
19 esac
20 done
23 if [ $# -ne 1 ] ; then
24 echo >&2 "Usage: $0 <command>"
25 exit 1
28 case "$1" in
29 hooks)
30 hooks
32 requires)
33 echo "all"
35 conflicts)
36 echo "new"
38 preceeds)
39 echo "all"
42 echo >&2 "$0: invalid command"
43 exit 1
45 esac