postrm is in tcpquota 1.6.15-13.
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 101 102 103 104 105 106 | #!/bin/sh
#
# postrm script for the Debian GNU/Linux tcpquota package
#
# Initial version written by Ian Murdock <imurdock@debian.org>
# This version rewritten by Turbo Fredriksson <turbo@tripnet.se>
set -e
if [ "$CFGDIR" = "" ]; then
CFGDIR=/etc/tcpquota
fi
remove_rcd() {
echo -n " Removing init links... "
update-rc.d -f tcpquota remove >/dev/null
echo "done."
}
case "$1" in
remove)
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d tcpquota stop
else
/etc/init.d/tcpquota stop
fi
remove_rcd
echo -n " Removing PID file... "
rm -f $DESTDIR/var/run/tcpquotad.pid >/dev/null
echo "done."
;;
purge)
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d tcpquota stop
else
/etc/init.d/tcpquota stop
fi
remove_rcd
# ----------------------
ENGINE=`grep ENGINE $CFGDIR/tcpquota.cf | awk -F= '{print $2}'`
if [ "$ENGINE" = "mSQL" ]; then
if `relshow | grep tcpquota > /dev/null 2>&1`; then
echo " There is still databases configured. Do you want me to"
echo " remove them for you?"
read -p " Remove databases? [y/N]" s
else
s=n
fi
if [ "$s" = "y" -o "$s" = "Y" ]; then
echo -n " Purging the TCPQuota/mSQL database... "
echo y | su msql -c "/usr/sbin/msqladmin drop tcpquota" \
>/dev/null 2>&1
echo "done."
echo -n " Restarting the mSQL daemon... "
su msql -c "/usr/sbin/msqladmin reload" > /dev/null 2>&1
echo "done."
fi
elif [ "$ENGINE" = "mysql" ]; then
if `mysqlshow | grep tcpquota > /dev/null 2>&1`; then
echo " There is still databases configured. Do you want me to"
echo " remove them for you?"
read -p " Remove databases? [y/N]" s
else
s=n
fi
if [ "$s" = "y" -o "$s" = "Y" ]; then
echo -n " Purging the TCPQuota/mySQL database... "
echo y | mysqladmin drop tcpquota > /dev/null 2>&1
echo "done."
echo -n " Restarting the mySQL daemon... "
mysqladmin reload > /dev/null 2>&1
echo "done."
fi
else
echo " Could not figure out which database engine you where using"
echo " leaving any database behind..."
fi
echo -n " Removing PID and LOG files ... "
rm -f $DESTDIR/var/run/tcpquotad.pid >/dev/null
rm -f $DESTDIR/var/log/tcpquotad.log* >/dev/null
echo "done."
;;
upgrade)
exit 0
;;
failed-upgrade|abort-install|abort-upgrade|disappear)
exit 0
;;
*)
echo "postrm called with unknown argument \`$1\'" >&2
exit 0
;;
esac
exit 0
|