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
|
#!/bin/sh
# postinst script for dma
set -e
. /usr/share/debconf/confmodule
db_version 2.0
umask 022
case "$1" in
configure)
db_get dma/mailname
echo "$RET" > /etc/mailname
# lkajan: example is apticron
tmpfile="$( mktemp -t dma.conf.XXXXXXXXXX )"
chown root:mail "$tmpfile"; chmod 0640 "$tmpfile"
cp -f /usr/share/dma/dma.conf "$tmpfile";
db_get dma/relayhost
if [ -n "$RET" ]; then
sed -i -re 's@^[[:space:]]*(#+[[:space:]]*)?SMARTHOST([[:space:]]+.*)?$@SMARTHOST '"$RET@" "$tmpfile"
else
sed -i -re 's@^[[:space:]]*(#+[[:space:]]*)?SMARTHOST([[:space:]]+.*)?$@#SMARTHOST@' "$tmpfile"
fi
ucf --debconf-ok --three-way "$tmpfile" /etc/dma/dma.conf
rm -f "$tmpfile"
ucfr dma /etc/dma/dma.conf
if dpkg --compare-versions "$2" lt-nl '0.10-1~'; then
chmod 0660 /var/spool/dma/flush > /dev/null 2>&1 || true
fi
;;
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
|