#!/bin/sh set -e lighttpd_remove() { if which lighty-disable-mod >/dev/null 2>&1 ; then lighty-disable-mod phpsysinfo || true fi if [ -L /etc/lighttpd/conf-enabled/50-phpsysinfo.conf ] ; then rm /etc/lighttpd/conf-enabled/50-phpsysinfo.conf fi } apache2_remove() { COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2-data' 2>/dev/null | awk '{print $3}' || true) if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then . /usr/share/apache2/apache2-maintscript-helper apache2_invoke disconf 50-phpsysinfo elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then if [ -L /etc/apache2/conf.d/50-phpsysinfo.conf ] ; then rm /etc/apache2/conf.d/50-phpsysinfo.conf fi fi } if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then . /usr/share/dbconfig-common/dpkg/postrm dbc_go phpsysinfo $@ fi if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then if [ -f /usr/share/debconf/confmodule ]; then db_get phpsysinfo/reconfigure-webserver || true webservers="$RET" rm -f /etc/avahi/services/phpsysinfo.service for webserver in $webservers; do webserver=${webserver%,} if [ "$webserver" = "lighttpd" ]; then lighttpd_remove elif [ "$webserver" = "apache2" ]; then # Need to pass params for apache2-maintscript-helper apache2_remove $@ fi done db_get phpsysinfo/restart-webserver res="$RET" if [ "$res" = "true" ]; then for webserver in $restart; do webserver=${webserver%,} if [ "$webserver" = "nginx" ]; then # The user needs to do some manual action continue fi # Redirection of 3 is needed because Debconf uses it and it might # be inherited by webserver. See bug #446324. if pathfind invoke-rc.d; then invoke-rc.d $webserver reload 3>/dev/null || true else /etc/init.d/$webserver reload 3>/dev/null || true fi done fi fi fi # Automatically added by dh_installdebconf/13.20 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section exit 0