/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to debian/mandos.postinst

* network-hooks.d: New directory.
* network-hooks.d/bridge: New example hook.
* network-hooks.d/bridge.conf: Config file for bridge example hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash -e
 
1
#!/bin/sh
2
2
# This script can be called in the following ways:
3
3
#
4
4
# After the package was installed:
15
15
# If prerm fails during replacement due to conflict:
16
16
#       <postinst> abort-remove in-favour <new-package> <version>
17
17
 
18
 
. /usr/share/debconf/confmodule
 
18
set -e
19
19
 
20
20
case "$1" in
21
21
    configure)
22
22
        # Rename old "mandos" user and group
23
 
        case "$(getent passwd mandos)" in
24
 
            *:Mandos\ password\ system,,,:/nonexistent:/bin/false)
25
 
                usermod --login _mandos mandos
26
 
                groupmod --new-name _mandos mandos
27
 
                ;;
28
 
        esac
 
23
        if dpkg --compare-versions "$2" lt "1.0.3-1"; then
 
24
            case "`getent passwd mandos`" in
 
25
                *:Mandos\ password\ system,,,:/nonexistent:/bin/false)
 
26
                    usermod --login _mandos mandos
 
27
                    groupmod --new-name _mandos mandos
 
28
                    ;;
 
29
            esac
 
30
        fi
29
31
        # Create new user and group
30
32
        if ! getent passwd _mandos >/dev/null; then
31
33
            adduser --system --force-badname --quiet \
39
41
        ;;
40
42
 
41
43
    *)
42
 
        echo "$0 called with unknown argument \`$1'" 1>&2
 
44
        echo "$0 called with unknown argument '$1'" 1>&2
43
45
        exit 1
44
46
        ;;
45
47
esac