repo.or.cz
/
vlock.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge with git+ssh://toidinamai@repo.or.cz/srv/git/vlock.git
[vlock.git]
/
scripts
/
hibernate.sh
blob
f35cbeb12d445753cb0f477fc1b2d5a86ecedc75
1
#!/bin/sh
2
3
set -e
4
5
hooks
() {
6
oldvt
=
$
(
fgconsole
)
7
8
while
read
hook_name
;
do
9
case
"
${hook_name}
"
in
10
vlock_start
)
11
chvt
63
12
;;
13
vlock_end
)
14
chvt
"
${oldvt}
"
15
;;
16
vlock_save
)
17
hibernate
18
;;
19
esac
20
done
21
}
22
23
if
[
$#
-ne
1
] ;
then
24
echo
>&
2
"Usage:
$0
<command>"
25
exit
1
26
fi
27
28
case
"
$1
"
in
29
hooks
)
30
hooks
31
;;
32
requires
)
33
echo
"all"
34
;;
35
conflicts
)
36
echo
"new"
37
;;
38
preceeds
)
39
echo
"all"
40
;;
41
*)
42
echo
>&
2
"
$0
: invalid command"
43
exit
1
44
;;
45
esac