postinst is in fprobe 1.1-7.3.
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 | #! /bin/sh -e
# postinst script for fprobe
# Use debconf.
. /usr/share/debconf/confmodule
# generate default file if it doesn't exist
if [ ! -e /etc/default/fprobe ]; then
cat > /etc/default/fprobe <<-END
#fprobe default configuration file
INTERFACE="eth0"
FLOW_COLLECTOR="localhost:2055"
#fprobe can't distinguish IP packet from other (e.g. ARP)
OTHER_ARGS="-fip"
END
fi
if [ "$1" = "configure" ]; then
db_get fprobe/interface && interface="$RET"
db_get fprobe/collector && collector="$RET"
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
test -z "$interface" || grep -Eq '^ *INTERFACE=' /etc/default/fprobe || \
echo "INTERFACE=" >> /etc/default/fprobe
test -z "$collector" || grep -Eq '^ *FLOW_COLLECTOR=' /etc/default/fprobe || \
echo "FLOW_COLLECTOR=" >> /etc/default/fprobe
sed -i "s/^INTERFACE=.*$/INTERFACE=\"$interface\"/" /etc/default/fprobe
sed -i "s/^FLOW_COLLECTOR=.*$/FLOW_COLLECTOR=\"$collector\"/" /etc/default/fprobe
fi
#close all fd's
db_stop
if [ "$1" = "configure" ] && [ -f /etc/init.d/fprobe-ng ]; then
echo "I: Removing fprobe-ng configuration files"
rm -f /etc/init.d/fprobe-ng
rm -f /etc/default/fprobe-ng
update-rc.d fprobe-ng remove >/dev/null || exit 0
fi
# Automatically added by dh_installinit
if [ -x "/etc/init.d/fprobe" ]; then
if [ ! -e "/etc/init/fprobe.conf" ]; then
update-rc.d fprobe defaults >/dev/null
fi
invoke-rc.d fprobe start || exit $?
fi
# End automatically added section
exit 0
|