From: Paul Donald Date: Sat, 30 Nov 2024 15:47:06 +0000 (+0100) Subject: ddns-scripts: refactor start_daemon_for_all_ddns_sections() X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=a36167288227c753b8a57ef875ff3eb8e6dd510a;p=openwrt-packages.git ddns-scripts: refactor start_daemon_for_all_ddns_sections() Removed redundant if else condition. updater is launched with the same verbosity value anyway. Signed-off-by: Paul Donald --- diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index 5d15cbef7..cb8423190 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -184,20 +184,14 @@ load_all_service_sections() { # and by /etc/init.d/ddns start start_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 - if [ $VERBOSE -eq 0 ]; then # start in background - /usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start & - else - /usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start - fi + 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 + /usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$section_id" -- start done }