mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
ddns-scripts: refactor stop_daemon_for_all_ddns_sections()
Same functionality - code reads less 'shouty' and 'stabby'. Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
committed by
Florian Eckert
parent
2ab29cc06c
commit
99da7eded2
@@ -220,16 +220,14 @@ stop_section_processes() {
|
|||||||
# and by /etc/init.d/ddns stop
|
# and by /etc/init.d/ddns stop
|
||||||
# needed because we also need to kill "sleep" child processes
|
# needed because we also need to kill "sleep" child processes
|
||||||
stop_daemon_for_all_ddns_sections() {
|
stop_daemon_for_all_ddns_sections() {
|
||||||
local __EVENTIF="$1"
|
local event_if sections section_id configured_if
|
||||||
local __SECTIONS=""
|
event_if="$1"
|
||||||
local __SECTIONID=""
|
|
||||||
local __IFACE=""
|
|
||||||
|
|
||||||
load_all_service_sections __SECTIONS
|
load_all_service_sections sections
|
||||||
for __SECTIONID in $__SECTIONS; do
|
for section_id in $sections; do
|
||||||
config_get __IFACE "$__SECTIONID" interface "wan"
|
config_get configured_if "$section_id" interface "wan"
|
||||||
[ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
|
[ -z "$event_if" ] || [ "$configured_if" = "$event_if" ] || continue
|
||||||
stop_section_processes "$__SECTIONID"
|
stop_section_processes "$section_id"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user