File: postinst

package info (click to toggle)
postgrey 1.36-5.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 620 kB
  • sloc: perl: 1,162; sh: 243; makefile: 17
file content (48 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (6)
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
#! /bin/sh
# postinst script for postgrey

set -e

# lintian: postinst-does-not-load-confmodule
. /usr/share/debconf/confmodule

case "$1" in
    configure)
        DBDIR='/var/lib/postgrey'

        getent passwd postgrey > /dev/null || \
            adduser --system --home "$DBDIR" --no-create-home \
                    --disabled-password --group postgrey
        # migration from old 'nogroup' postgrey (1.23-1 and earlier):
        getent group postgrey > /dev/null || \
            addgroup --system postgrey

        install -d -o postgrey -g postgrey -m 0700 "$DBDIR"

        ucf --debconf-ok --three-way \
            /usr/share/postgrey/whitelist_clients \
            /etc/postgrey/whitelist_clients
        ucf --debconf-ok --debconf-ok --three-way \
            /usr/share/postgrey/whitelist_recipients \
            /etc/postgrey/whitelist_recipients
        ucf --debconf-ok --three-way \
            /usr/share/postgrey/postgrey-default \
            /etc/default/postgrey
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

# without this, debconf hangs after end of postinst.
db_stop

exit 0