/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release
237.11.13 by Teddy Hogeborn
Miscellaneous fixes prompted by lintian:
1
#!/bin/sh
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
2
# This script can be called in the following ways:
3
#
4
# After the package was removed:
5
#       <postrm> remove
6
#
7
# After the package was purged:
8
#       <postrm> purge
9
#
10
# After the package was upgraded:
11
#       <old-postrm> upgrade <new-version>
12
# if that fails:
13
#       <new-postrm> failed-upgrade <old-version>
14
#
15
#
16
# After all of the packages files have been replaced:
17
#       <postrm> disappear <overwriting-package> <version>
18
#
19
#
20
# If preinst fails during install:
21
#       <new-postrm> abort-install
22
#
23
# If preinst fails during upgrade of removed package:
24
#       <new-postrm> abort-install <old-version>
25
#
26
# If preinst fails during upgrade:
27
#       <new-postrm> abort-upgrade <old-version>
28
237.11.13 by Teddy Hogeborn
Miscellaneous fixes prompted by lintian:
29
set -e
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
30
195 by Teddy Hogeborn
* debian/control (mandos, mandos-client): Depend on "adduser".
31
# Update the initial RAM file system image
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
32
update_initramfs()
33
{
237.7.697 by Teddy Hogeborn
Client: Debian package fix: Make uninstall when using dracut(8) work
34
    if command -v update-initramfs >/dev/null; then
237.7.836 by Teddy Hogeborn
Fix #1079588 by not outputting to stdout in maintainer scripts
35
	update-initramfs -k all -u 1>&2
237.7.697 by Teddy Hogeborn
Client: Debian package fix: Make uninstall when using dracut(8) work
36
    elif command -v dracut >/dev/null; then
37
	# Logic taken from dracut.postinst
38
	for kernel in /boot/vmlinu[xz]-*; do
39
	    kversion="${kernel#/boot/vmlinu[xz]-}"
40
	    if [ "$kversion" != "*" ]; then
237.7.836 by Teddy Hogeborn
Fix #1079588 by not outputting to stdout in maintainer scripts
41
		/etc/kernel/postinst.d/dracut "$kversion" 1>&2
237.7.697 by Teddy Hogeborn
Client: Debian package fix: Make uninstall when using dracut(8) work
42
	    fi
43
	done
44
    fi
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
45
}
46
47
case "$1" in
48
    remove)
49
	update_initramfs
50
	;;
51
52
    purge)
237.7.828 by Teddy Hogeborn
Very minor security improvement when uninstalling package
53
	shred --remove /etc/keys/mandos/seckey.txt \
54
	    /etc/keys/mandos/tls-privkey.pem 2>/dev/null || :
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
55
	rm --force /etc/mandos/plugin-runner.conf \
56
	    /etc/keys/mandos/pubkey.txt \
237.7.327 by Teddy Hogeborn
Debian bug fix for mandos-client: Remove dhparams.pem on purge.
57
	    /etc/keys/mandos/seckey.txt \
237.7.510 by Teddy Hogeborn
Add support for using raw public keys in TLS (RFC 7250)
58
	    /etc/keys/mandos/tls-privkey.pem \
59
	    /etc/keys/mandos/tls-pubkey.pem \
237.7.327 by Teddy Hogeborn
Debian bug fix for mandos-client: Remove dhparams.pem on purge.
60
	    /etc/keys/mandos/dhparams.pem 2>/dev/null
237.7.12 by Teddy Hogeborn
* debian/mandos-client.postrm (purge): Bug fix: update initramfs also
61
	update_initramfs
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
62
	;;
63
    upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
64
	;;
65
66
    *)
237.2.38 by Teddy Hogeborn
* debian/mandos-client.postinst: Converted to Bourne shell. Also
67
	echo "$0 called with unknown argument '$1'" 1>&2
185 by Teddy Hogeborn
* .bzr-builddeb/default.conf: New.
68
	exit 1
69
	;;
70
esac
71
72
#DEBHELPER#
73
74
exit 0