Increase the stored value redundancy to 6.
[quix0rs-apt-p2p.git] / debian / postinst
1 #! /bin/sh
2 # postinst script for apt-p2p
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 . /usr/share/debconf/confmodule
9
10 # summary of how this script can be called:
11 #        * <postinst> `configure' <most-recently-configured-version>
12 #        * <old-postinst> `abort-upgrade' <new version>
13 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14 #          <new-version>
15 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
16 #          <failed-install-package> <version> `removing'
17 #          <conflicting-package> <version>
18 # for details, see http://www.debian.org/doc/debian-policy/ or
19 # the debian-policy package
20 #
21 # quoting from the policy:
22 #     Any necessary prompting should almost always be confined to the
23 #     post-installation script, and should be protected with a conditional
24 #     so that unnecessary prompting doesn't happen if a package's
25 #     installation fails and the `postinst' is called with `abort-upgrade',
26 #     `abort-remove' or `abort-deconfigure'.
27
28 case "$1" in
29     configure)
30                 if ! getent passwd apt-p2p >/dev/null; then
31                         adduser --quiet --system --no-create-home \
32                                         --home /var/cache/apt-p2p --disabled-password \
33                                         --disabled-login --shell /bin/false --ingroup nogroup \
34                                         apt-p2p
35                 fi
36                 
37                 touch /var/log/apt-p2p.log
38                 chown apt-p2p:adm /var/log/apt-p2p.log
39                 mkdir -p /var/cache/apt-p2p
40                 chown -R apt-p2p:adm /var/cache/apt-p2p
41     ;;
42
43     abort-upgrade|abort-remove|abort-deconfigure)
44     ;;
45
46     *)
47             echo "postinst called with unknown argument \`$1'" >&2
48             exit 1
49     ;;
50 esac
51
52 # Tell debconf to stop so it doesn't get confused
53 db_stop
54
55 # dh_installdeb will replace this with shell code automatically
56 # generated by other debhelper scripts.
57
58 #DEBHELPER#
59
60 exit 0