X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=apache2-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;h=0588a0ffd6af2a2eb96505de9ddb30fde1fce7a0;hp=941cdccc39c94eb84f3542eddae8187babfc15a5;hb=b0aaaaefbf10a1e20c50cb243fd4b21b283930e0;hpb=ed9c8bc9f8313d02a198b456e3d97fcd2d86521b diff --git a/debian/postinst b/debian/postinst index 941cdcc..0588a0f 100755 --- a/debian/postinst +++ b/debian/postinst @@ -615,6 +615,25 @@ for file in $CONF $log_mask; do done +# Check and remove obsolete "Include /etc/apache2/sites-enabled/[^.#]*" from +# /etc/apache2/apache2.conf. +# +if egrep -iq "^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/\[\^\.\#\]\*$" "$CONF"; then + + cp_echo "CN: Fixing obsolete Include line in $CONF." + CONFTMP=`mktemp $CONF.tmp.XXXXXX` + sed -r "/^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/\[\^\.\#\]\*$/Id" \ + "$CONF" > "$CONFTMP" + + if ! egrep -iq "^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/$" "$CONFTMP"; then + echo "Include /etc/apache2/sites-enabled/" >> "$CONFTMP" + fi + + cp_mv "$CONFTMP" "$CONF" + need_restart=1 +fi + + # Start Apache2 web server on boot? # This will enable Apache2 in /etc/default/apache2 file. #