File: postinst

package info (click to toggle)
chkrootkit 0.58b-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,796 kB
  • sloc: sh: 187,089; ansic: 3,779; makefile: 103
file content (57 lines) | stat: -rw-r--r-- 1,959 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
#!/bin/sh
# postinst script for #PACKAGE#
set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "${1-}" in
		abort-upgrade|abort-remove|abort-deconfigure)
		;;
		configure)
				old_version="${2-}"
				# 0.57-1 creates a spurious empty file /usr/lib/chkrootkit/1 is created when chkrootkit ran
				if [ -n "$old_version" ] && dpkg --compare-versions "$old_version" le 0.57-2; then
						if [ -e /usr/lib/chkrootkit/1 ]; then
								if [ -s /usr/lib/chkrootkit/1 ]; then
										echo "Warning: Not deleting /usr/lib/chkrootkit/1 as it is not empty. This should not happen"
								else
										rm /usr/lib/chkrootkit/1 || :
								fi
						fi
				fi
				if [ -n "$old_version" ] && dpkg --compare-versions "$old_version" le 0.55-2~; then
						# bullseye or earlier had settings in a non-conffile
						# ($old_config) that was created using debconf (with some
						# questionable advice on defaults)
						# remove debconf
						if [ -e /usr/share/debconf/confmodule ]; then
								. /usr/share/debconf/confmodule
								# Remove debconf settings
								db_purge || true
						fi
				fi
				config=/etc/chkrootkit/chkrootkit.conf
				old_config=/etc/chkrootkit.conf
				if [ -e "$old_config" ]; then
						echo "WARNING: $old_config is deprecated. Please put your settings in $config instead."
				fi
				;;
    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0