parse drop-in config folder rather than only one config file

This commit is contained in:
Patrick Schleizer 2019-12-20 05:49:11 -05:00
parent 66fd31189d
commit 46466c12ad
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48
2 changed files with 8 additions and 3 deletions

View File

@ -7,8 +7,6 @@
exit_code=0
config_file="/etc/permission-hardening.conf"
echo_wrapper() {
echo "run: $@"
"$@"
@ -161,6 +159,13 @@ set_file_perms() {
done < "$config_file"
}
parse_config_folder() {
shopt -s nullglob
for config_file in /etc/permission-hardening.d/*.conf /usr/local/etc/permission-hardening.d/*.conf; do
set_file_perms
done
}
parse_config_folder
exit "$exit_code"