X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dsa-metapackages.git;a=blobdiff_plain;f=apache2-vhost-update;h=24d59c8853fc907c6b0c4a48c2a0ed335f36b340;hp=a61369edeecf9c9b2622dabc94b3435efdd0c526;hb=1ef5c152f6a95df0f53e86bee06e139f12e70361;hpb=15fadc336d0d511bd4faac6f1031985070d9a12d diff --git a/apache2-vhost-update b/apache2-vhost-update index a61369e..24d59c8 100755 --- a/apache2-vhost-update +++ b/apache2-vhost-update @@ -16,10 +16,10 @@ # All config changes are tracked in RCS. # # needs something like this in sudoers: -# %apachectrl ALL=(root) /usr/sbin/restart-apache +# %apachectrl ALL=(root) /usr/sbin/apache2-vhost-update -# Copyright (c) 2009 Peter Palfrader +# Copyright (c) 2009,2010 Peter Palfrader # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -122,6 +122,20 @@ if grep -i include "$DESTINATION/$site" > /dev/null; then exit 1 fi +if grep -i LoadModule "$DESTINATION/$site" > /dev/null; then + echo "New site may have LoadModule statements - rejecting." >&2 + rm -f "$DESTINATION/$site" + co "$DESTINATION/$site" + exit 1 +fi + +if grep -i LoadFile "$DESTINATION/$site" > /dev/null; then + echo "New site may have LoadFile statements - rejecting." >&2 + rm -f "$DESTINATION/$site" + co "$DESTINATION/$site" + exit 1 +fi + /usr/sbin/apache2ctl configtest if [ "$?" != "0" ]; then echo "configtest returned errors; reverting." >&2 @@ -130,6 +144,9 @@ if [ "$?" != "0" ]; then exit 1 fi +echo "Differences:" +rcsdiff -u "$DESTINATION/$site" + echo "update run by $USER($SUDO_USER) at `date -R -u` on `hostname -f`" | \ ci -u "$DESTINATION/$site" if [ "$?" != "0" ]; then