postinst is in yadifa 2.3.7-1build1.
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #!/bin/sh
# postinst script for yadifa
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
if [ "$1" = configure ]; then
# lets give them a yadifa user/group in all cases.
if ! getent passwd yadifa >/dev/null; then
adduser --quiet --system --group --home /var/lib/yadifa --no-create-home yadifa
fi
# no sumfile means you get the default
[ -f /var/lib/yadifa/yadifa-default.md5sum ] ||
echo "6c3c952227a3f370f2f905fc2f821c15 /etc/default/yadifa" > /var/lib/yadifa/yadifa-default.md5sum
if [ -e /etc/default/yadifa ] && \
[ "$(cat /var/lib/yadifa/yadifa-default.md5sum)" = "$(md5sum /etc/default/yadifa)" ]; then
config="/etc/default/yadifa"
elif [ ! -e /etc/default/yadifa ]; then
config="/etc/default/yadifa"
else
config="/etc/default/yadifa.dpkg-dist"
fi
if [ "$config" = "/etc/default/yadifa" ]; then
md5sum /etc/default/yadifa > /var/lib/yadifa/yadifa-default.md5sum
fi
# Make /var/lib/yadifa dirs writeable by yadifa:yadifa user
dpkg-statoverride --list /var/lib/yadifa >/dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/lib/yadifa
dpkg-statoverride --list /var/lib/yadifa/keys > /dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/lib/yadifa/keys
dpkg-statoverride --list /var/lib/yadifa/masters > /dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/lib/yadifa/masters
dpkg-statoverride --list /var/lib/yadifa/slaves > /dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/lib/yadifa/slaves
dpkg-statoverride --list /var/lib/yadifa/xfr > /dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/lib/yadifa/xfr
dpkg-statoverride --list /var/log/yadifa > /dev/null || dpkg-statoverride --update --add yadifa yadifa 0755 /var/log/yadifa
# should not be needed anymore
# if pidof /usr/sbin/yadifad >/dev/null 2>&1; then
# invoke-rc.d yadifa restart
# else
# invoke-rc.d yadifa start
# fi
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_systemd_enable/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'yadifa.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'yadifa.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'yadifa.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'yadifa.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/yadifa.conf >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/yadifa" ]; then
update-rc.d yadifa defaults >/dev/null || exit 1
fi
fi
# End automatically added section
exit 0
|