Debian Codegraph @

debian/aptly-api.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 # source debconf library
6 . /usr/share/debconf/confmodule
7
8 case "$1" in
9 configure|reconfigure)
10 # create an aptly-api group and user
11 if ! getent passwd aptly-api > /dev/null; then
12 useradd --system --user-group --create-home --home-dir /var/lib/aptly-api aptly-api
13 fi
14
15 # set config file permissions not world readable as it may contain secrets
16 chown root:aptly-api /etc/aptly.conf
17 chmod 640 /etc/aptly.conf
18 ;;
19
20 abort-upgrade|abort-remove|abort-deconfigure)
21 ;;
22
23 *)
24 echo "postinst called with unknown argument \`$1'" >&2
25 exit 1
26 ;;
27 esac
28
29 #DEBHELPER#
30
31 exit 0