inventory.sh: Get included directories
Not only wildcard
This commit is contained in:
parent
17d1f6069a
commit
07e2e8913e
12
inventory.sh
12
inventory.sh
|
@ -35,9 +35,15 @@ get_confs() {
|
||||||
while [ "$confs_size" -lt "$(stat -c %s "$confs")" ]; do
|
while [ "$confs_size" -lt "$(stat -c %s "$confs")" ]; do
|
||||||
confs_size=$(stat -c %s "$confs")
|
confs_size=$(stat -c %s "$confs")
|
||||||
for conf_file in $(cat "$confs"); do
|
for conf_file in $(cat "$confs"); do
|
||||||
# XXX: Expand the filenames
|
# Get all Include directives
|
||||||
for glob in $(awk '/^[[:space:]]*Include/ {print $2}' "$conf_file"); do
|
for included in $(awk '/^[[:space:]]*Include/ {print $2}' "$conf_file"); do
|
||||||
realpath --canonicalize-existing --quiet $glob >> "$confs" || true
|
# In case a directory is included even tho it's not recomended
|
||||||
|
if [ -d "$included" ]; then
|
||||||
|
included=$included/*
|
||||||
|
fi
|
||||||
|
# XXX: Expand the filenames
|
||||||
|
realpath --canonicalize-existing --quiet $included \
|
||||||
|
| grep -v mods-available >> "$confs" || true
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
sort "$confs" | uniq > "$confs"_tmp && mv "$confs"_tmp "$confs"
|
sort "$confs" | uniq > "$confs"_tmp && mv "$confs"_tmp "$confs"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Machine
|
* Machine
|
||||||
** hosting05
|
** hosting05
|
||||||
- /etc/apache2/sites-enabled/acelem.conf
|
- /etc/apache2/sites-enabled/acelem.conf
|
||||||
- /etc/apache2/mods-enabled/status.conf
|
- /etc/apache2/mods-enabled/status.conf
|
||||||
- /home/labri/www/zp-data/.htaccess
|
- /home/labri/www/zp-data/.htaccess
|
||||||
- /home/oldwiki/www/bleuroy/.htaccess
|
- /home/oldwiki/www/bleuroy/.htaccess
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue