fixes if package is removed before being configured
This commit is contained in:
parent
bc86048a8f
commit
ff02e0649a
|
@ -6,35 +6,42 @@ 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"
|
||||||
webservers="$RET"
|
if [ $? -eq 0 ]; then
|
||||||
restart=""
|
set -e
|
||||||
for server in $webservers; do
|
webservers="$RET"
|
||||||
server=${server%,}
|
restart=""
|
||||||
case "$server" in
|
for server in $webservers; do
|
||||||
apache2)
|
server=${server%,}
|
||||||
rm -f /etc/$server/conf.d/ldap-account-manager
|
case "$server" in
|
||||||
test -x /usr/sbin/$server || continue
|
apache2)
|
||||||
restart="$restart $server"
|
rm -f /etc/$server/conf.d/ldap-account-manager
|
||||||
;;
|
test -x /usr/sbin/$server || continue
|
||||||
esac
|
restart="$restart $server"
|
||||||
done
|
;;
|
||||||
db_get "ldap-account-manager/restart-webserver"
|
esac
|
||||||
if [ "$RET" = "true" ]; then
|
done
|
||||||
for server in $restart; do
|
|
||||||
server=${server%,}
|
|
||||||
if [ -x /usr/sbin/invoke-rc.d ]; then
|
|
||||||
invoke-rc.d $server restart
|
|
||||||
else
|
|
||||||
/etc/init.d/$server restart
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
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 restart
|
||||||
|
else
|
||||||
|
/etc/init.d/$server restart
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
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
|
||||||
|
db_purge
|
||||||
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
|
|
||||||
db_purge
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#DEBHELPER#
|
#DEBHELPER#
|
||||||
|
|
Loading…
Reference in New Issue