postinst is in snort-common 2.9.7.0-5build1.
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 | #!/bin/sh -e
. /usr/share/debconf/confmodule
test $DEBIAN_SCRIPT_DEBUG && set -v -x
# Check if Snort will be able to run properly
# Obviously, if you are using deprecated preprocessors (checked on config)
# it's not going to work either, but we do not test for that here.
#
# TODO: Maybe it's also best if we could tell dpkg that snort should
# not be started if this fails.
if [ -x /etc/init.d/snort ] ; then
# Try to find if we are expecting the script to run
enabled=0
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
set +e
invoke-rc.d --query snort start
if [ $? -ne 104 ] ; then
# Disabled, or does not work, do not check the configuration
enabled=1
fi
set -e
fi
if [ "$enabled" -eq 0 ] ; then
set +e
/etc/init.d/snort config-check >/dev/null 2>&1
if [ $? -ne 0 ] ; then
db_input critical snort/config_error || true
db_go || true
fi
set -e
fi
fi
db_stop
exit 0
|