File: /var/lib/dpkg/info/bitninja.postrm
#!/bin/sh
# postrm script for bitninja
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
failed-upgrade|abort-upgrade|disappear)
for pid in $(ps -ef | grep bitninja | awk '$8~"inotifywait" {print $2}'); do kill -9 $pid; done
;;
upgrade)
;;
remove)
for pid in $(ps -ef | grep bitninja | awk '$8~"inotifywait" {print $2}'); do kill -9 $pid; done
if [ -d /var/lib/bitninja ]; then
echo "Removing directory: /var/lib/bitninja" >&2
rm -rf /var/lib/bitninja
fi
if [ -d /var/log/bitninja ]; then
echo "Removing directory: /var/log/bitninja" >&2
rm -rf /var/log/bitninja
fi
if [ -d /opt/bitninja ]; then
echo "Removing directory: /opt/bitninja" >&2
rm -rf /opt/bitninja
fi
if [ -e /etc/init.d/bitninja ]; then
echo "Removing file: /etc/init.d/bitninja" >&2
rm -rf /etc/init.d/bitninja
fi
if [ -e /usr/local/bin/wpninja ]; then
echo "Removing file: /usr/local/bin/wpninja"
rm -rf /usr/local/bin/wpninja
fi
if [ -e /etc/systemd/system/bitninja.service ]; then
echo "Removing file: /etc/systemd/system/bitninja.service" >&2
rm -rf /etc/systemd/system/bitninja.service
fi
if [ -e /etc/logrotate.d/bitninja ]; then
echo "Removing file: /etc/logrotate.d/bitninja" >&2
rm -rf /etc/logrotate.d/bitninja
fi
;;
purge|abort-install)
for pid in $(ps -ef | grep bitninja | awk '$8~"inotifywait" {print $2}'); do kill -9 $pid; done
if [ -d /var/lib/bitninja ]; then
echo "Removing directory: /var/lib/bitninja" >&2
rm -rf /var/lib/bitninja
fi
if [ -d /var/log/bitninja ]; then
echo "Removing directory: /var/log/bitninja" >&2
rm -rf /var/log/bitninja
fi
if [ -d /etc/bitninja ]; then
echo "Removing directory: /etc/bitninja" >&2
rm -rf /etc/bitninja
fi
if [ -d /opt/bitninja ]; then
echo "Removing directory: /opt/bitninja" >&2
rm -rf /opt/bitninja
fi
if [ -e /etc/init.d/bitninja ]; then
echo "Removing file: /etc/init.d/bitninja" >&2
rm -rf /etc/init.d/bitninja
fi
if [ -e /usr/local/bin/wpninja ]; then
echo "Removing file: /usr/local/bin/wpninja"
rm -rf /usr/local/bin/wpninja
fi
if [ -e /etc/systemd/system/bitninja.service ]; then
echo "Removing file: /etc/systemd/system/bitninja.service" >&2
rm -rf /etc/systemd/system/bitninja.service
fi
if [ -e /etc/logrotate.d/bitninja ]; then
echo "Removing file: /etc/logrotate.d/bitninja" >&2
rm -rf /etc/logrotate.d/bitninja
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0