postinst is in ifupdown2 1.0~git20170314-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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | #!/bin/sh
# postinst script for ifupdown2
#
# 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
process_udev()
{
# override default udev bridge and hotplug rules because they interfere with
# networking init script
udev_user_rulesdir=/etc/udev/rules.d/
udev_sys_rulesdir=/lib/udev/rules.d/
if [ -e $udev_user_rulesdir ]; then
udev_ifupdown2_overrides="80-networking.rules
60-bridge-network-interface.rules"
for u in ${udev_ifupdown2_overrides}
do
if [ -e ${udev_sys_rulesdir}/$u -a ! -e ${udev_user_rulesdir}/$u ]; then
(cd ${udev_user_rulesdir} && ln -sf /dev/null $u)
fi
done
fi
}
MYNAME="${0##*/}"
report() { echo "${MYNAME}: $*" ; }
report_warn() { report "Warning: $*" >&2 ; }
report_err() { report "Error: $*" >&2 ; }
case "$1" in
configure)
# Generic stuff done on all configurations
if [ -f /etc/network/interfaces ] ; then
if ! grep -q "^[[:space:]]*iface[[:space:]]\+lo0\?[[:space:]]\+inet[[:space:]]\+loopback\>" /etc/network/interfaces ; then
report_warn "No 'iface lo' definition found in /etc/network/interfaces"
fi
if ! grep -q "^[[:space:]]*\(allow-\|\)auto[[:space:]]\+\(.*[[:space:]]\+\|\)lo0\?\([[:space:]]\+\|$\)" /etc/network/interfaces ; then
report_warn "No 'auto lo' statement found in /etc/network/interfaces"
fi
else # ! -f /etc/network/interfaces
if [ -z "$2" ]; then
echo "Creating /etc/network/interfaces."
echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces
echo "auto lo" >> /etc/network/interfaces
echo "iface lo inet loopback" >> /etc/network/interfaces
else
report_warn "/etc/network/interfaces does not exist"
fi
fi
process_udev
;;
purge)
;;
esac
dpkg-maintscript-helper rm_conffile "/etc/bash_completion.d/ifup" 1.1 -- $@
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p ifupdown2 /usr/share/ifupdown2 -V 2.6-
fi
# End automatically added section
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask networking.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled networking.service; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable networking.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 networking.service >/dev/null || true
fi
# End automatically added section
exit 0
|