filter backup from the inventory
This commit is contained in:
parent
7503f22eda
commit
9a64e82c48
13
inventory.sh
13
inventory.sh
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue