postrm is in psad 2.2.1-2.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 | #!/bin/sh
set -e
# In case the user want to purge all files of the psad package, we must remove
# manually pid, fifo and log files before the main directories are removed.
if [ "$1" = "purge" ]; then
# Handle the /var/run/psad directory that contains pid and socket files
if [ -d /var/run/psad ];then
find /var/run/psad/ -type f -exec rm {} \;
find /var/run/psad/ -type s -exec rm {} \;
rmdir /var/run/psad
fi
# Clean the config directory /etc/psad
if [ -d /etc/psad/archive ]; then
find /etc/psad/archive/ -type f -exec rm {} \;
rmdir /etc/psad/archive
fi
# Remove the fifo file which psad creates
if [ -d /var/lib/psad ]; then
find /var/lib/psad -type p -exec rm {} \;
fi
# Handle the /var/log/psad directory that contains log files
if [ -d /var/log/psad ]; then
rm -rf /var/log/psad/*
fi
fi
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
update-rc.d psad remove >/dev/null
fi
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
exit 0
|