mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-30 22:32:49 +03:00
chore: extract outbound section check into _check_outbound_section and call it via config_foreach
This commit is contained in:
@@ -79,10 +79,7 @@ check_requirements() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
has_outbound_section() {
|
_check_outbound_section() {
|
||||||
local section_exists=1
|
|
||||||
|
|
||||||
check_section() {
|
|
||||||
local section="$1"
|
local section="$1"
|
||||||
local proxy_string interface outbound_json urltest_proxy_links
|
local proxy_string interface outbound_json urltest_proxy_links
|
||||||
|
|
||||||
@@ -95,9 +92,12 @@ has_outbound_section() {
|
|||||||
[ -n "$outbound_json" ] || [ -n "$urltest_proxy_links" ]; then
|
[ -n "$outbound_json" ] || [ -n "$urltest_proxy_links" ]; then
|
||||||
section_exists=0
|
section_exists=0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
config_foreach check_section "section"
|
has_outbound_section() {
|
||||||
|
local section_exists=1
|
||||||
|
|
||||||
|
config_foreach _check_outbound_section "section"
|
||||||
|
|
||||||
return $section_exists
|
return $section_exists
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user