6 . /usr/share/debconf/confmodule
17 CONFDIR="/etc/apache2"
23 # Purge Apache2 configuration files located in specified directory.
40 if [ -d "${dir}" ] && [ -n "$(ls -A ${dir}/)" ]; then
41 for file in ${dir}/*.conf; do
42 if [ -f "$file" ]; then
43 if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" "$file"; then
44 a2dis$ctype -p -f -q "`basename "$file" .conf`" || exit $?
52 # Configuration generated by this CARNet package.
53 echo "CN: Purging $PKG configuration for Apache2."
54 purge_conf site ${CONFDIR}/sites-available
55 purge_conf conf ${CONFDIR}/conf-available
57 # Remove default DocumentRoot if there's only a one line index.html there
58 docroots="/var/www/$HOST /var/www/www.$DOMAIN"
60 if [ -d "/var/www" ]; then
61 for docroot in $docroots; do
62 if [ -d $docroot ]; then
63 if [ "x$(echo ${docroot}/*)" = "x${docroot}/index.html" ]; then
64 if [ "$(wc -l ${docroot}/index.html | awk '{print $1}')" -eq 1 ]; then
65 echo "CN: Removing document root directory ${docroot}."
66 rm -f $docroot/index.html
67 rmdir $docroot || true