X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=636f90f207e877bea04becb2b260098e2c208411;hb=004b3242cd6b9933ea049039840f1071b0284ad8;hp=0000000000000000000000000000000000000000;hpb=bf15ba44749a701dc0eb2bd65205d19a17397928;p=quix0rs-apt-p2p.git diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..636f90f --- /dev/null +++ b/debian/postinst @@ -0,0 +1,55 @@ +#! /bin/sh +# postinst script for apt-dht +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + if ! getent passwd aptdht >/dev/null; then + adduser --quiet --system --no-create-home \ + --home /var/cache/apt-dht --disabled-password \ + --disabled-login --shell /bin/false --ingroup nogroup \ + aptdht + fi + + touch /var/log/apt-dht.log + chown aptdht:adm /var/log/apt-dht.log + mkdir -p /var/cache/apt-dht + chown -R aptdht:adm /var/cache/apt-dht + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0