2
# This script can be called in the following ways:
4
# After the package was installed:
5
# <postinst> configure <old-version>
8
# If prerm fails during upgrade or fails on failed upgrade:
9
# <old-postinst> abort-upgrade <new-version>
11
# If prerm fails during deconfiguration of a package:
12
# <postinst> abort-deconfigure in-favour <new-package> <version>
13
# removing <old-package> <version>
15
# If prerm fails during replacement due to conflict:
16
# <postinst> abort-remove in-favour <new-package> <version>
18
. /usr/share/debconf/confmodule
20
# Update the initial RAM file system image
23
if [ -x /usr/sbin/update-initramfs ]; then
24
update-initramfs -u -k all
30
# Rename old "mandos" user and group
31
case "$(getent passwd mandos)" in
32
*:Mandos\ password\ system,,,:/nonexistent:/bin/false)
33
usermod --login _mandos mandos
34
groupmod --new-name _mandos mandos
38
# Create new user and group
39
if ! getent passwd _mandos >/dev/null; then
40
adduser --system --force-badname --quiet --home /nonexistent \
41
--no-create-home --group --disabled-password \
42
--gecos "Mandos password system" _mandos
46
# Create client key pair
48
if [ -r /etc/keys/mandos/pubkey.txt \
49
-a -r /etc/keys/mandos/seckey.txt ]; then
52
if [ -x /usr/sbin/mandos-keygen ]; then
63
abort-upgrade|abort-deconfigure|abort-remove)
67
echo "$0 called with unknown argument \`$1'" 1>&2