fixes if package is removed before being configured

This commit is contained in:
Roland Gruber 2010-08-16 18:08:39 +00:00
parent bc86048a8f
commit ff02e0649a
1 changed files with 32 additions and 25 deletions

View File

@ -6,7 +6,10 @@ if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ] db_version 2.0 || [ $? -lt 30 ]
set +e
db_get "ldap-account-manager/config-webserver" db_get "ldap-account-manager/config-webserver"
if [ $? -eq 0 ]; then
set -e
webservers="$RET" webservers="$RET"
restart="" restart=""
for server in $webservers; do for server in $webservers; do
@ -19,8 +22,12 @@ if [ -f /usr/share/debconf/confmodule ]; then
;; ;;
esac esac
done done
fi
set +e
db_get "ldap-account-manager/restart-webserver" db_get "ldap-account-manager/restart-webserver"
if [ "$RET" = "true" ]; then if [ $? -eq 0 && "$RET" = "true" ]; then
set -e
for server in $restart; do for server in $restart; do
server=${server%,} server=${server%,}
if [ -x /usr/sbin/invoke-rc.d ]; then if [ -x /usr/sbin/invoke-rc.d ]; then
@ -30,10 +37,10 @@ if [ -f /usr/share/debconf/confmodule ]; then
fi fi
done done
fi fi
set -e
if [ "$1" = "purge" ]; then if [ "$1" = "purge" ]; then
rm -r -f /usr/share/ldap-account-manager; rm -r -f /var/lib/ldap-account-manager; fi rm -r -f /usr/share/ldap-account-manager; rm -r -f /var/lib/ldap-account-manager; fi
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
db_purge db_purge
fi fi