LDAPAccountManager/lam-packaging/debian/postrm

64 lines
1.4 KiB
Plaintext
Raw Normal View History

2006-01-20 15:33:13 +00:00
#!/bin/bash
set -e
2007-04-29 19:49:43 +00:00
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]
2006-01-20 15:33:13 +00:00
2010-10-13 18:26:38 +00:00
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
2007-04-29 19:49:43 +00:00
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
2013-07-19 21:06:13 +00:00
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
2007-04-29 19:49:43 +00:00
db_get "ldap-account-manager/restart-webserver"
2010-08-16 18:23:14 +00:00
if [ $? -eq 0 ] && [ "$RET" = "true" ]; then
set -e
for server in $restart; do
server=${server%,}
if [ -x /usr/sbin/invoke-rc.d ]; then
2015-05-10 08:30:45 +00:00
/usr/sbin/invoke-rc.d $server reload
elif [ -x /usr/sbin/service ]; then
/usr/sbin/service $server reload
elif [ -x /bin/systemctl ]; then
/bin/systemctl ${server}.service reload
fi
done
2007-04-29 19:49:43 +00:00
fi
set -e
2007-04-29 19:49:43 +00:00
if [ "$1" = "purge" ]; then
2010-08-16 18:23:14 +00:00
rm -r -f /usr/share/ldap-account-manager
rm -r -f /var/lib/ldap-account-manager
db_purge
2007-04-29 19:49:43 +00:00
fi
#DEBHELPER#
db_stop
2006-01-20 15:33:13 +00:00
fi
exit 0