From 71e49db330c53dd6316fc6625470fd70dfc673ce Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 3 Jul 2023 11:41:18 +0200 Subject: [PATCH] extract "include_files" function --- CHANGELOG.md | 2 ++ minifirewall | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42d68a9..c79d36f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp ### Changed +* extract "include_files" function + ### Deprecated ### Removed diff --git a/minifirewall b/minifirewall index 3922e88..259770e 100755 --- a/minifirewall +++ b/minifirewall @@ -254,10 +254,16 @@ source_configuration() { source_file_or_error "${config_file}" fi } +include_files() { + if [ -d "${includes_dir}" ]; then + find ${includes_dir} -type f -readable -not -name '*.*' | sort -h + else + echo "" + fi +} source_includes() { if [ -d "${includes_dir}" ]; then - include_files=$(find ${includes_dir} -type f -readable -not -name '*.*' | sort -h) - for include_file in ${include_files}; do + for include_file in $(include_files); do source_file_or_error "${include_file}" done fi