filter backup from the inventory

This commit is contained in:
Brice Waegeneire 2021-02-01 17:00:04 +01:00
parent 7503f22eda
commit 9a64e82c48

View file

@ -61,17 +61,20 @@ get_template() {
grep -lRE '^[[:space:]]*(Order|Allow|Deny|Satisfy)[[:space:]]' \
--exclude-dir=apache2 --exclude-dir=squid3 $template_dirs \
|| true
filter_backup() {
grep -v 'apreq.bak' || true
}
# Put different type of configs in different files
categorize_confs() {
get_template > "$confs_template"
get_htaccess > "$confs_htaccess"
grep -E "^${apache_dir}/sites-available/.*\\.conf" "$confs" > "$confs_vhost"
grep -Ev "^${apache_dir}/sites-available/.*\\.conf" "$confs" > "$confs_system"
get_template | filter_backup > "$confs_template"
get_htaccess | filter_backup > "$confs_htaccess"
grep -E "^${apache_dir}/sites-available/.*\\.conf" "$confs" \
| filter_backup > "$confs_vhost"
grep -Ev "^${apache_dir}/sites-available/.*\\.conf" "$confs" \
| filter_backup> "$confs_system"
}
# Count directives and return files only containing some directives
# Takes argument: file type
count_directives() {