2006-01-20 15:33:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-04-17 17:30:34 +00:00
|
|
|
if [ "$1" = "upgrade" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
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/sess
|
|
|
|
rm -f /usr/share/ldap-account-manager/tmp
|
|
|
|
rm -f /usr/share/ldap-account-manager/config
|
|
|
|
|
2010-08-16 18:08:39 +00:00
|
|
|
set +e
|
2007-04-29 19:49:43 +00:00
|
|
|
db_get "ldap-account-manager/config-webserver"
|
2010-08-16 18:08:39 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
set -e
|
|
|
|
webservers="$RET"
|
|
|
|
restart=""
|
|
|
|
for server in $webservers; do
|
|
|
|
server=${server%,}
|
|
|
|
case "$server" in
|
|
|
|
apache2)
|
2017-04-17 17:53:07 +00:00
|
|
|
set +e
|
|
|
|
a2query -q -c ldap-account-manager && a2disconf -q ldap-account-manager
|
|
|
|
set -e
|
2013-07-19 21:06:13 +00:00
|
|
|
rm -f /etc/$server/conf-available/ldap-account-manager.conf
|
2010-08-16 18:08:39 +00:00
|
|
|
test -x /usr/sbin/$server || continue
|
|
|
|
restart="$restart $server"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
2016-04-02 13:33:19 +00:00
|
|
|
|
2010-08-16 18:08:39 +00:00
|
|
|
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
|
2010-08-16 18:08:39 +00:00
|
|
|
set -e
|
|
|
|
for server in $restart; do
|
|
|
|
server=${server%,}
|
2017-09-28 15:57:46 +00:00
|
|
|
if [ `which invoke-rc.d` ]; then
|
2016-04-02 13:33:19 +00:00
|
|
|
invoke-rc.d $server reload
|
|
|
|
elif [ `which service` ]; then
|
|
|
|
service $server reload
|
2010-08-16 18:08:39 +00:00
|
|
|
fi
|
|
|
|
done
|
2007-04-29 19:49:43 +00:00
|
|
|
fi
|
2016-04-02 13:33:19 +00:00
|
|
|
|
2010-08-16 18:08:39 +00:00
|
|
|
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
|
2010-08-16 18:08:39 +00:00
|
|
|
db_purge
|
2007-04-29 19:49:43 +00:00
|
|
|
fi
|
2016-04-02 13:33:19 +00:00
|
|
|
|
2007-04-29 19:49:43 +00:00
|
|
|
#DEBHELPER#
|
2016-04-02 13:33:19 +00:00
|
|
|
|
2007-04-29 19:49:43 +00:00
|
|
|
db_stop
|
2016-04-02 13:33:19 +00:00
|
|
|
|
2006-01-20 15:33:13 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|