chore: extract outbound section check into _check_outbound_section and call it via config_foreach

This commit is contained in:
Andrey Petelin
2025-10-19 19:19:59 +05:00
parent 08615b6f04
commit c0e3e256e3

View File

@@ -79,10 +79,7 @@ check_requirements() {
fi
}
has_outbound_section() {
local section_exists=1
check_section() {
_check_outbound_section() {
local section="$1"
local proxy_string interface outbound_json urltest_proxy_links
@@ -95,9 +92,12 @@ has_outbound_section() {
[ -n "$outbound_json" ] || [ -n "$urltest_proxy_links" ]; then
section_exists=0
fi
}
}
config_foreach check_section "section"
has_outbound_section() {
local section_exists=1
config_foreach _check_outbound_section "section"
return $section_exists
}