X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostrm;h=06719d31f6accec19e344063770ae2049a2439a5;hb=HEAD;hp=325beea77dd9b0881c4abd2bb237cc52131d80e9;hpb=efcba04e69e03fa428d417afac63b38073852eaf;p=apache2-cn.git diff --git a/debian/postrm b/debian/postrm index 325beea..c63c1f1 100755 --- a/debian/postrm +++ b/debian/postrm @@ -6,12 +6,12 @@ set -e . /usr/share/debconf/confmodule case "$1" in - purge) - # continue below - ;; - *) - exit 0 - ;; + purge) + # continue below + ;; + *) + exit 0 + ;; esac CONFDIR="/etc/apache2" @@ -23,33 +23,33 @@ DOMAIN=$(hostname -d) # Purge Apache2 configuration files located in specified directory. # purge_conf () { - local ctype dir file + local ctype dir file - ctype="$1" - dir="$2" + ctype="$1" + dir="$2" - case "$ctype" in - site|conf) - # continue below - ;; - *) - return 1 - ;; - esac + case "$ctype" in + site|conf) + # continue below + ;; + *) + return 1 + ;; + esac - if [ -d "${dir}" ] && [ -n "$(ls -A ${dir}/)" ]; then - for file in ${dir}/*.conf; do - if [ -f "$file" ]; then - if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" "$file"; then - a2dis$ctype -p -f -q "`basename "$file" .conf`" || exit $? - rm -f "$file" - fi - fi - done - fi + if [ -d "${dir}" ] && [ -n "$(ls -A ${dir}/)" ]; then + for file in ${dir}/*.conf; do + if [ -f "$file" ]; then + if egrep -q "^## Begin - Generated by CARNET package apache2-cn$" "$file"; then + a2dis$ctype -p -f -q "`basename "$file" .conf`" || exit $? + rm -f "$file" + fi + fi + done + fi } -# Configuration generated by this CARNet package. +# Configuration generated by this CARNET package. echo "CN: Purging $PKG configuration for Apache2." purge_conf site ${CONFDIR}/sites-available purge_conf conf ${CONFDIR}/conf-available @@ -58,17 +58,17 @@ purge_conf conf ${CONFDIR}/conf-available docroots="/var/www/$HOST /var/www/www.$DOMAIN" if [ -d "/var/www" ]; then - for docroot in $docroots; do - if [ -d $docroot ]; then - if [ "x$(echo ${docroot}/*)" = "x${docroot}/index.html" ]; then - if [ "$(wc -l ${docroot}/index.html | awk '{print $1}')" -eq 1 ]; then - echo "CN: Removing document root directory ${docroot}." - rm -f $docroot/index.html - rmdir $docroot || true - fi - fi + for docroot in $docroots; do + if [ -d $docroot ]; then + if [ "x$(echo ${docroot}/*)" = "x${docroot}/index.html" ]; then + if [ "$(wc -l ${docroot}/index.html | awk '{print $1}')" -eq 1 ]; then + echo "CN: Removing document root directory ${docroot}." + rm -f $docroot/index.html + rmdir $docroot || true fi - done + fi + fi + done fi #DEBHELPER#