File: vlock.postinst

package info (click to toggle)
vlock 2.2.2-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 488 kB
  • ctags: 324
  • sloc: ansic: 2,950; sh: 873; makefile: 236
file content (50 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh -e

# inspired by the tor postinst script
# checking vlock group

gid=`getent group vlock | cut -d ":" -f 3`

# if there is the uid the account is there and we can do
# the sanit(ar)y checks otherwise we can safely create it.

if [ -z "$gid" ]; then
    # what this might mean?? oh creating a system l^Huser!
    addgroup --quiet \
            --system \
	    vlock 
fi

#They are not available anymore, so they can be safely removed if they exist. 

for i in /usr/sbin/vlock-nosysrq /usr/sbin/vlock-new /usr/sbin/vlock-current /usr/lib/vlock/modules/new.so
do
	# only do something when no setting exists
	if dpkg-statoverride --list $i >/dev/null 2>&1
	then
		dpkg-statoverride --remove $i 
	fi
done

# no statoverrides necessary for the following files anymore
for i in /usr/lib/vlock/modules/all.so /usr/sbin/vlock-main; do
	if dpkg-statoverride --list "$i" >/dev/null; then
		dpkg-statoverride --remove "$i"
	fi
done

#privileged modules

for i in /usr/lib/vlock/modules/nosysrq.so
do
	# only do something when no setting exists
	if ! dpkg-statoverride --list $i >/dev/null 2>&1
	then
		dpkg-statoverride --update --add root vlock 754 $i
	fi
done


#DEBHELPER#

exit 0