postrm is in fwsnort 1.6.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 | #!/bin/sh
set -e
# In case the user wants to purge the fwsnort package, we must manually remove
# some files.
if [ "$1" = "purge" ]; then
# Remove old log files (default directory)
if [ -d /var/log/fwsnort ]; then
find /var/log/fwsnort/ -type f -exec rm {} \;
rmdir /var/log/fwsnort
fi
# Every time fwsnort is used to generate an iptables script, if an old
# script is found, the previous one is moved to the archives directory.
# Therefore, we have to make sure we remove this directory and the default
# generated scripts.
if [ -d /var/lib/fwsnort/archive ]; then
find /var/lib/fwsnort/archive/ -type f -exec rm {} \;
rmdir /var/lib/fwsnort/archive
fi
if [ -d /var/lib/fwsnort/ ]; then
find /var/lib/fwsnort/ -type f -exec rm {} \;
fi
# We take care of the default directory where users can store their rules.
if [ -d /etc/fwsnort/snort_rules ]; then
find /etc/fwsnort/snort_rules/ -type f -exec rm {} \;
fi
fi
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section
exit 0
|