File: aptly-api.postinst

package info (click to toggle)
aptly 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,928 kB
  • sloc: python: 10,398; sh: 252; makefile: 184
file content (31 lines) | stat: -rwxr-xr-x 664 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

set -e

# source debconf library
. /usr/share/debconf/confmodule

case "$1" in
    configure|reconfigure)
        # create an aptly-api group and user
        if ! getent passwd aptly-api > /dev/null; then
	    useradd --system --user-group --create-home --home-dir /var/lib/aptly-api aptly-api
        fi

        # set config file permissions not world readable as it may contain secrets
        chown root:aptly-api /etc/aptly.conf
        chmod 640 /etc/aptly.conf
    ;;

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

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

#DEBHELPER#

exit 0