apache2/find_httpd2_includes

32 lines
632 B
Bash

#!/bin/bash
# Read the configuration (recursing through all include files)
. /usr/share/apache2/load_configuration
: ${sysconfdir:=/etc/apache2}
httpd_conf=${APACHE_HTTPD_CONF:-$sysconfdir/httpd.conf}
find_include_files () {
local found i
found=$(awk '/^[[:space:]]*Include/ { print $2 }' $1 2>/dev/null)
for i in $found; do
case $i in
*\**)
# filter filenames that are unexpanded, in the lack of a match,
# like /etc/apache2/conf.d/*.conf
;;
*)
conffiles="$conffiles $i"
find_include_files $i
;;
esac
done
}
find_include_files $httpd_conf
#echo $httpd_conf $conffiles
echo $conffiles
exit 0