This file is indexed.

postinst is in unbound 1.5.8-1ubuntu1.

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
#!/bin/sh -e

action="$1"
oldversion="$2"

if [ "$action" = configure ]; then
    if ! getent passwd unbound >/dev/null; then
        adduser --quiet --system --group --no-create-home --home /var/lib/unbound unbound
    fi
    chown unbound:unbound /var/lib/unbound

    if [ ! -f /etc/unbound/unbound_control.key ]; then
        unbound-control-setup 1>/dev/null 2>&1 || true
    fi

    # Clean up permissions on the resolvconf forwarder hook on upgrades (#816425)
    if dpkg --compare-versions "$oldversion" lt-nl 1.5.8-1~; then
        if [ -f /etc/resolvconf/update.d/unbound ]; then
            chmod -x /etc/resolvconf/update.d/unbound
        fi
    fi
fi

# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/unbound" ]; then
		update-rc.d unbound defaults >/dev/null
	fi
	if [ -x "/etc/init.d/unbound" ] || [ -e "/etc/init/unbound.conf" ]; then
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d unbound $_dh_action || true
	fi
fi
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/default/unbound 1.5.7-2~ -- "$@"
# End automatically added section