Created
January 4, 2012 07:06
-
-
Save debility-zz/1558897 to your computer and use it in GitHub Desktop.
apache config converter v0.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CONFIG_FILE="/etc/httpd/conf/httpd.conf" | |
DATE=`date '+%Y%m%d'` | |
if [ -f "${CONFIG_FILE}.orig.${DATE}" ]; then | |
echo '(maybe)apache config file is already converted. :-P' | |
exit | |
fi | |
cp $CONFIG_FILE ${CONFIG_FILE}.orig.${DATE} | |
sed \ | |
-e '/^Alias\s\/icons/s/^/#/' \ | |
-e '/^Alias\s\/error/s/^/#/' \ | |
-e '/^ScriptAlias\s\/cgi-bin/s/^/#/' \ | |
-e '/<Directory "\/var\/www\/icons">/,/<\/Directory>/s/^/#/' \ | |
-e '/<Directory "\/var\/www\/cgi-bin">/,/<\/Directory>/s/^/#/' \ | |
-e '/<Directory "\/var\/www\/error">/,/<\/Directory>/s/^/#/' \ | |
${CONFIG_FILE} > ${CONFIG_FILE}.edit | |
mv -f ${CONFIG_FILE}.edit ${CONFIG_FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment