X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostrm;fp=debian%2Fpostrm;h=5171fe39071959e87d12a3b3e09db73810447306;hb=251b0e7421babc128a48dbf1d25d049efc566e7b;hp=cd04f2b75ccdaf8cdf7ff5c3b674575cbd2d2f5d;hpb=1ed1f8732e5e0135f53922da0d53b23b5a040751;p=apache2-cn.git diff --git a/debian/postrm b/debian/postrm index cd04f2b..5171fe3 100755 --- a/debian/postrm +++ b/debian/postrm @@ -17,71 +17,70 @@ sitefiles= case "$1" in purge) - # Get CARNet config files in /etc/apache2/sites-available directory. - if [ -d "${sitesdir}" ] && [ -n "$(ls ${sitesdir}/)" ]; then + # continue below + ;; + *) + exit 0 + ;; +esac - for file in ${sitesdir}/*; do - if [ -f "$file" ]; then - if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" $file; then - site=`echo "$file" | sed 's/^\/.*\///'` - sitefiles="$sitefiles $site" - fi - fi - done +# Get CARNet config files in /etc/apache2/sites-available directory. +if [ -d "${sitesdir}" ] && [ -n "$(ls ${sitesdir}/)" ]; then + for file in ${sitesdir}/*; do + if [ -f "$file" ]; then + if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" $file; then + site=`echo "$file" | sed 's/^\/.*\///'` + sitefiles="$sitefiles $site" + fi fi - - # Remove our vhosts. - if [ -n "$sitefiles" ]; then - for site in $sitefiles; do - - if [ -e "$sitesdir/$site" ]; then - - cp_echo "CN: Removing $site site configuration file." - rm -f $sitesdir/$site - fi - done + done +fi + +# Remove our vhosts. +if [ -n "$sitefiles" ]; then + for site in $sitefiles; do + if [ -e "$sitesdir/$site" ]; then + cp_echo "CN: Removing $site site configuration file." + rm -f $sitesdir/$site fi - - # Remove default DocumentRoot if there's only a one line index.html there - 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 - - cp_echo "CN: Removing document root directory ${docroot}." - rm -f $docroot/index.html - rmdir $docroot || true - fi - fi + done +fi + +# Remove default DocumentRoot if there's only a one line index.html there +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 + cp_echo "CN: Removing document root directory ${docroot}." + rm -f $docroot/index.html + rmdir $docroot || true fi - done + fi fi - - # Remove CARNet specific configuration. - if [ -d "${CONFDIR}/conf.d" ] && [ -n "$(ls ${CONFDIR}/conf.d/)" ]; then - cp_echo "CN: Disabling CARNet specific configuration." - for file in ${CONFDIR}/conf.d/*; do - if [ -f "$file" ]; then - if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" $file; then - rm -f $file - fi - fi - done + done +fi + +# Remove CARNet specific configuration. +if [ -d "${CONFDIR}/conf.d" ] && [ -n "$(ls ${CONFDIR}/conf.d/)" ]; then + cp_echo "CN: Disabling CARNet specific configuration." + for file in ${CONFDIR}/conf.d/*; do + if [ -f "$file" ]; then + if egrep -q "^## Begin - Generated by CARNet package apache2-cn$" $file; then + rm -f $file + fi fi + done +fi - # Debconf purge - db_purge +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. - # Mail root - cp_mail "apache2-cn" - ;; - *) - ;; -esac +#DEBHELPER# + +# Mail root +cp_mail "apache2-cn" exit 0