File: pglistener.postinst

package info (click to toggle)
pglistener 4
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 224 kB
  • ctags: 132
  • sloc: python: 594; perl: 364; sh: 120; sql: 89; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
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
#! /bin/sh

set -e

case "$1" in
    configure)
        if ! getent passwd pglisten >/dev/null; then
            echo "Creating pglistener user account..."
            adduser --home /var/lib/pglistener \
                --gecos "pgListener system user" \
                --system --quiet --group --disabled-password pglisten

        fi

        mkdir -p /var/lib/pglistener/hooks
        chown pglisten:pglisten /var/lib/pglistener/hooks

        chown pglisten:pglisten /etc/pglistener
        chmod 700 /etc/pglistener
    ;;

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

    ;;

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

#DEBHELPER#

exit 0