postinst is in exabgp 4.0.2-2.
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 | #!/bin/sh
set -e
CONFIGFILE="/etc/exabgp/exabgp.env"
TMPCONF="/etc/exabgp/exabgp.env.dpkg-tmp"
gen_env_config() {
echo "Generating /etc/exabgp/exabgp.env."
trap 'rm -f $TMPCONF' TERM INT EXIT QUIT
exabgp --fi >> "$TMPCONF" 2>/dev/null
sed -i "s#nobody#exabgp#" "$TMPCONF"
ucf $TMPCONF $CONFIGFILE
rm -f $TMPCONF
}
# Remove previous configuration files
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
for f in processes/dynamic-1.sh processes/watchdog-1.sh processes/healthcheck.py; do
if ! egrep -q "$f" /etc/exabgp/exabgp.conf 2> /dev/null ; then
dpkg-maintscript-helper rm_conffile /etc/exabgp/"$f" -- "$@" ; fi
done
dpkg-maintscript-helper rm_conffile /etc/default/exabgp 3.4.9-0~ -- "$@"
# exabgp.conf should stay here only if it was modified by the
# user. If this is the case, we move it back at its previous
# location.
dpkg-maintscript-helper rm_conffile /etc/exabgp/exabgp.conf 3.4.9-0~ -- "$@"
if [ -f "/etc/exabgp/exabgp.conf.dpkg-bak" -a ! -f "/etc/exabgp/exabgp.conf" ]; then
echo "Move back exabgp.conf.dpkg-bak to exabgp.conf ..."
mv /etc/exabgp/exabgp.conf.dpkg-bak /etc/exabgp/exabgp.conf
fi
if [ -d "/etc/exabgp/processes/" ] ; then rmdir /etc/exabgp/processes 2>/dev/null || true ; fi
fi
case "$1" in
configure)
adduser --quiet --system --group --disabled-login --home /var/run/exabgp exabgp
gen_env_config
;;
esac
# Automatically added by dh_installinit/11ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/exabgp" ]; then
update-rc.d exabgp defaults >/dev/null
invoke-rc.d exabgp start || exit $?
fi
fi
# End automatically added section
exit 0
|