This file is indexed.

postinst is in dictd 1.12.1+dfsg-2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
# vim: ts=4:et:sts=4
# $Id: dictd.postinst 110 2009-03-08 22:43:11Z robert $

set -e

PACKAGE=dictd
DEFAULTSFILE=/etc/default/$PACKAGE

updateRunMode()
{
    RUN_MODE="$1"
    TMPFILE="$DEFAULTSFILE.dpkg-tmp"
    TEMPLATEFILE="/usr/share/$PACKAGE/ucf/default.template"
    MD5SUMSFILE="/usr/share/$PACKAGE/ucf/default.md5sums"

    sed -e "s/^[[:space:]]*RUN_MODE[[:space:]]*=.*/RUN_MODE=\"${RUN_MODE}\"/" \
                < "$TEMPLATEFILE" > "$TMPFILE"
    chmod 0644 "$TMPFILE"
    ucf --debconf-ok --sum-file "$MD5SUMSFILE" --three-way "$TMPFILE" "$DEFAULTSFILE"
    ucfr "$PACKAGE" "$DEFAULTSFILE"
    rm -f "$TMPFILE"

    DICTD_ARGS=""
    . "$DEFAULTSFILE"

    if [ "$RUN_MODE" = "inetd" ] ; then
        # Add service to /etc/inetd.conf
        update-inetd \
            --group OTHER \
            --add "dict\tstream\ttcp\tnowait\tdictd.dictd\t/usr/sbin/tcpd\t/usr/sbin/dictd $DICTD_ARGS --inetd"
        update-inetd --enable dict
    else
        update-inetd --disable dict
    fi
}

. /usr/share/debconf/confmodule

case "$1" in
     configure)
        # Remove shutdown and reboot links; this init script doesn't need them.
        if dpkg --compare-versions "$2" lt "1.11.0.dfsg-1~"; then
            rm -f /etc/rc0.d/K20dictd /etc/rc6.d/K20dictd
        fi

        # Create dictd system user
        getent passwd dictd > /dev/null || \
            adduser --quiet --system --home /var/lib/dictd  --no-create-home \
            --gecos 'Dictd Server' --group dictd

        db_get dictd/run_mode || true
        updateRunMode "$RET"

        # Run our config script
        [ ! -x /usr/sbin/dictdconfig ] || dictdconfig -w


        ;;

    failed-upgrade|abort-upgrade|abort-remove|abort-deconfigure|in-favour|removing)
        ;;

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

# Automatically added by dh_installinit
if [ -x "/etc/init.d/dictd" ]; then
	if [ ! -e "/etc/init/dictd.conf" ]; then
		update-rc.d dictd start 20 2 3 4 5 . stop 20 1 . >/dev/null
	fi
	invoke-rc.d dictd start || exit $?
fi
# End automatically added section


exit 0