more robust reload

This commit is contained in:
Roland Gruber 2016-04-02 15:33:19 +02:00
parent bd85a89d4c
commit bd93daa397
1 changed files with 12 additions and 10 deletions

View File

@ -30,34 +30,36 @@ if [ -f /usr/share/debconf/confmodule ]; then
esac esac
done done
fi fi
set +e set +e
db_get "ldap-account-manager/restart-webserver" db_get "ldap-account-manager/restart-webserver"
if [ $? -eq 0 ] && [ "$RET" = "true" ]; then if [ $? -eq 0 ] && [ "$RET" = "true" ]; then
set -e set -e
for server in $restart; do for server in $restart; do
server=${server%,} server=${server%,}
if [ `which invoke-rc.d` ]; then if [ `which systemctl` ]; then
invoke-rc.d $server reload if [ "`systemctl is-active ${server}.service`" = "active" ]; then
elif [ `which service` ]; then
service $server reload
elif [ `which systemctl` ]; then
systemctl reload ${server}.service systemctl reload ${server}.service
fi
elif [ `which invoke-rc.d` ]; then
invoke-rc.d $server reload
elif [ `which service` ]; then
service $server reload
fi fi
done done
fi fi
set -e set -e
if [ "$1" = "purge" ]; then if [ "$1" = "purge" ]; then
rm -r -f /usr/share/ldap-account-manager rm -r -f /usr/share/ldap-account-manager
rm -r -f /var/lib/ldap-account-manager rm -r -f /var/lib/ldap-account-manager
db_purge db_purge
fi fi
#DEBHELPER# #DEBHELPER#
db_stop db_stop
fi fi
exit 0 exit 0