File: unbound.postinst

package info (click to toggle)
unbound 1.13.1-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,604 kB
  • sloc: ansic: 110,494; sh: 6,028; yacc: 3,391; python: 1,945; makefile: 1,689; awk: 161; perl: 158; xml: 36
file content (24 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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

#DEBHELPER#