diff options
author | Michael Boelen <michael@cisofy.com> | 2015-09-07 22:06:08 +0300 |
---|---|---|
committer | Michael Boelen <michael@cisofy.com> | 2015-09-07 22:06:08 +0300 |
commit | 59390f17178ce82fe6abc3746937d79695000a3f (patch) | |
tree | 1686e8d2d74fd65a3250a1f6da844c9b6afef823 /include/tests_webservers | |
parent | 48fd39c57032fa15b87281693b62725caef80481 (diff) | |
parent | b83c3fbb10600964963b96c4099867822b56fcb0 (diff) |
Merge pull request #73 from laurentquillerou/nginx-conf
Include main nginx.conf file in parsing.
Diffstat (limited to 'include/tests_webservers')
-rw-r--r-- | include/tests_webservers | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/tests_webservers b/include/tests_webservers index 8c457f0d..cfe6dcce 100644 --- a/include/tests_webservers +++ b/include/tests_webservers @@ -198,9 +198,9 @@ # # Configuration specific tests # SERVERTOKENSFOUND=0 # APACHE_CONFIGFILES="${APACHE_CONFIGFILE} /usr/local/etc/apache22/extra/httpd-default.conf /etc/apache2/sysconfig.d/global.conf" -# +# # for APACHE_CONFIGFILE in ${APACHE_CONFIGFILES}; do -# if [ -f ${APACHE_CONFIGFILE} ]; then +# if [ -f ${APACHE_CONFIGFILE} ]; then # # Check if option ServerTokens is configured # SERVERTOKENSTEST=`cat ${APACHE_CONFIGFILE} | grep ServerTokens | grep -v '^#'` # if [ ! "${SERVERTOKENSTEST}" = "" ]; then @@ -219,17 +219,17 @@ # else # Display --indent 4 --text "- Checking option ServerTokens" --result "NOT FOUND" --color WHITE # fi -# +# # else # # File does not exist, skipping # logtext "File ${APACHE_CONFIGFILE} does not exist, so skipping tests on this file" # fi # done -# +# # # Display results from checks # if [ ${SERVERTOKENSFOUND} -eq 1 ]; then # Display --indent 6 --text "- Value of ServerTokens" --result OK --color GREEN -# else +# else # Display --indent 6 --text "- Value of ServerTokens" --result WARNING --color RED # ReportWarning ${TEST_NO} "M" "Value of 'ServerTokens' in Apache config is different than template" # fi @@ -422,6 +422,7 @@ # Remove temp file if [ ! "${TMPFILE}" = "" ]; then if [ -f ${TMPFILE} ]; then rm -f ${TMPFILE}; fi; fi N=0 + cat ${NGINX_CONF_LOCATION} | sed -e 's/^[ \t]*//' | grep -v "^#" | grep -v "^$" | sed 's/[\t]/ /g' | sed 's/ / /g' | sed 's/ / /g' >> ${TMPFILE} # Search for included configuration files (may include directories and wild cards) FIND=`grep "include" ${NGINX_CONF_LOCATION} | ${AWKBINARY} '{ if ($1=="include") { print $2 }}' | sed 's/;$//g'` for I in ${FIND}; do |