LDAPAccountManager/lam-packaging/debian/postrm

62 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-06-12 17:21:14 +00:00
#!/bin/bash
set -e
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]
rm -f /usr/share/ldap-account-manager/lib/fpdf.php
rm -f /usr/share/ldap-account-manager/sess
rm -f /usr/share/ldap-account-manager/tmp
rm -f /usr/share/ldap-account-manager/config
set +e
db_get "ldap-account-manager/config-webserver"
if [ $? -eq 0 ]; then
set -e
webservers="$RET"
restart=""
for server in $webservers; do
server=${server%,}
case "$server" in
apache2)
rm -f /etc/$server/conf.d/ldap-account-manager
rm -f /etc/$server/conf-available/ldap-account-manager.conf
rm -f /etc/$server/conf-enabled/ldap-account-manager.conf
test -x /usr/sbin/$server || continue
restart="$restart $server"
;;
esac
done
fi
set +e
db_get "ldap-account-manager/restart-webserver"
if [ $? -eq 0 ] && [ "$RET" = "true" ]; then
set -e
for server in $restart; do
server=${server%,}
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d $server reload
else
/etc/init.d/$server reload
fi
done
fi
set -e
if [ "$1" = "purge" ]; then
rm -r -f /usr/share/ldap-account-manager
rm -r -f /var/lib/ldap-account-manager
db_purge
fi
#DEBHELPER#
db_stop
fi
exit 0