postinst is in fetchmail 6.3.26-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 fetchmail
# $Id: fetchmail.postinst 469 2008-05-18 12:47:05Z nion $
#
set -e
# Create fetchmail user and its homedir if we may need it
if ! getent passwd fetchmail >/dev/null; then
adduser --system --ingroup nogroup --home /var/lib/fetchmail \
--shell /bin/false --disabled-password fetchmail
fi
# if the login shell is not /bin/false, change this, see #481727
LOGINSH=$(getent passwd fetchmail | cut -d ':' -f 7)
if [ "x$LOGINSH" != "x/bin/false" ]; then
chsh -s /bin/false fetchmail
fi
if ! [ -d /var/lib/fetchmail ]; then
mkdir -p /var/lib/fetchmail
fi
chmod 700 /var/lib/fetchmail
chown -h -R fetchmail:nogroup /var/lib/fetchmail
# Code to handle the upgrade to use /etc/default/fetchmail
case "$1" in
configure)
if dpkg --compare-versions "$2" lt 6.3.1
then
if [ -e /etc/fetchmailrc ]
then
if [ `grep -c poll /etc/fetchmailrc` ]
then
# If /etc/fetchmailrc exits and is defined a pool line
# I assume is correctly configured and make the default to
# run on boot
FILE=`mktemp`
cat /etc/default/fetchmail | sed 's/START_DAEMON=no/START_DAEMON=yes/' > $FILE
mv $FILE /etc/default/fetchmail
fi
fi
# update home directory for old installations because of #327250
usermod -d /var/lib/fetchmail fetchmail
# Removing old /var/run/fetchmail if empty
rm -f "/var/run/fetchmail/.fetchids" >/dev/null 2>&1 || true
rm -f "/var/run/fetchmail/.fetchmail-UIDL-cache" >/dev/null 2>&1 || true
if [ ! -f "/var/lib/fetchmail/.fetchmail.pid" ]
then
mv "/var/run/fetchmail/.fetchmail.pid" "/var/lib/fetchmail/.fetchmail.pid" >/dev/null 2>&1 || true
fi
rmdir "/var/run/fetchmail" >/dev/null 2>&1 || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
esac
if [ -x /etc/init.d/fetchmail ]; then
update-rc.d fetchmail start 99 2 3 4 5 . >/dev/null
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d --quiet fetchmail start || true
else
/etc/init.d/fetchmail start || true
fi
fi
exit 0
# vim:ts=4:sw=4:
|