# and by /etc/init.d/ddns stop
# needed because we also need to kill "sleep" child processes
stop_daemon_for_all_ddns_sections() {
- local __EVENTIF="$1"
- local __SECTIONS=""
- local __SECTIONID=""
- local __IFACE=""
-
- load_all_service_sections __SECTIONS
- for __SECTIONID in $__SECTIONS; do
- config_get __IFACE "$__SECTIONID" interface "wan"
- [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
- stop_section_processes "$__SECTIONID"
+ local event_if sections section_id configured_if
+ event_if="$1"
+
+ load_all_service_sections sections
+ for section_id in $sections; do
+ config_get configured_if "$section_id" interface "wan"
+ [ -z "$event_if" ] || [ "$configured_if" = "$event_if" ] || continue
+ stop_section_processes "$section_id"
done
}