postinst is in autotrust 0.3.1-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #!/bin/sh
# postinst script for autotrust
#
# see: dh_installdeb(1)
set -e
set_perms() {
if ! dpkg-statoverride --list "$4" >/dev/null; then
dpkg-statoverride --update --add "$@"
fi
}
case "$1" in
configure)
if ! getent passwd autotrust > /dev/null; then
adduser --quiet --system --group --no-create-home --home /var/lib/autotrust autotrust
fi
set_perms root autotrust 0750 /etc/autotrust
# Install configuration files
for conf in autotrust.conf keys.conf; do
ucf /usr/share/autotrust/$conf /etc/autotrust/$conf
ucfr autotrust /etc/autotrust/$conf
set_perms root autotrust 0640 /etc/autotrust/$conf
done
if dpkg --compare-versions "$2" le 0.2.1-1; then
[ -f /etc/autotrust/autotrust.conf.sample ] && rm /etc/autotrust/autotrust.conf.sample
fi
# Create autotrust directories
for dir in /var/lib/autotrust /var/lib/autotrust/keys /var/lib/autotrust/anchors; do
mkdir -p $dir
set_perms autotrust autotrust 0750 $dir
done
for file in br.anchors cz.anchors pr.anchors se.anchors anchors.mf; do
set_perms autotrust autotrust 0640 /var/lib/autotrust/anchors/$file
done
# Create autotrust log directory
mkdir -p /var/log/autotrust
set_perms autotrust adm 0750 /var/log/autotrust
# Reload AppArmor profile
if [ -x /etc/init.d/apparmor ]; then
invoke-rc.d apparmor force-reload || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Automatically added by dh_installinit
if [ -x "/etc/init.d/autotrust" ]; then
update-rc.d autotrust defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d autotrust start || exit $?
else
/etc/init.d/autotrust start || exit $?
fi
fi
# End automatically added section
exit 0
|