File: vlock.postinst

package info (click to toggle)
vlock 2.2.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 580 kB
  • sloc: ansic: 2,946; sh: 871; makefile: 208
file content (38 lines) | stat: -rw-r--r-- 918 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
#!/bin/sh

set -e

# inspired by the tor postinst script
# checking vlock group

gid="$(getent group vlock | cut -d ':' -f 3)"

if [ -z "$gid" ]; then
	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-new /usr/sbin/vlock-current \
	 /usr/sbin/vlock-nosysrq /usr/lib/vlock/modules/new.so; do
	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 2>&1; then
		dpkg-statoverride --remove "$i"
	fi
done

# privileged modules
for i in /usr/lib/vlock/modules/nosysrq.so; do
	if ! dpkg-statoverride --list "$i" >/dev/null 2>&1; then
		dpkg-statoverride --update --add root vlock 0754 "$i"
	fi
done

#DEBHELPER#

exit 0