From ac05f71abfe872d8d7edcc47ae7876c9b428d89c Mon Sep 17 00:00:00 2001 From: dharmik Date: Sun, 19 Apr 2026 11:15:21 +0530 Subject: [PATCH] ddns-scripts: clarify -N behavior and improve legacy syntax hint Clarify why this change updates help/error text around the option name. The issue is not that -N is always wrong. The current parser behavior expects the lower-case form here, so showing -N in these messages is misleading and suggests a form that does not work in this code path. Also improve grammar in the multi-command error and add a focused hint for legacy '
' usage so existing scripts are easier to adjust. This is message-level guidance only; no runtime parsing behavior changes. Fixes: #27737 --- .../files/usr/lib/ddns/dynamic_dns_updater.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh index e6f91e8ee08f58..a56ada12fd15e1 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -28,7 +28,7 @@ stop Stop NETWORK or all Parameters: -n NETWORK Start/Stop sections in background monitoring NETWORK, force VERBOSE=0 -S SECTION SECTION to start - use either -N NETWORK or -S SECTION + use either -n NETWORK or -S SECTION -h show this help and exit -V show version and exit @@ -63,9 +63,19 @@ while getopts ":hv:dn:S:V" OPT; do done shift $((OPTIND - 1 )) # OPTIND is 1 based -[ -n "$NETWORK" -a -n "$SECTION_ID" ] && usage_err "use either option '-N' or '-S' not both" +[ -n "$NETWORK" -a -n "$SECTION_ID" ] && usage_err "use either option '-n' or '-S' not both" [ $# -eq 0 ] && usage_err "missing command" -[ $# -gt 1 ] && usage_err "to much commands" +if [ $# -gt 1 ]; then + if [ -z "$NETWORK" -a -z "$SECTION_ID" ]; then + case "$1:$2" in + start:*|stop:*|reload:*) ;; + *:[0-9]*) + usage_err "legacy syntax detected ('$1 $2'); use '-S $1 -v $2 -- start'" + ;; + esac + fi + usage_err "too many commands" +fi case "$1" in start)