]> git.99rst.org Git - openwrt-packages.git/commitdiff
ddns-scripts: support version output in frontend
authorJiang Tengfei <redacted>
Fri, 26 Jun 2026 14:33:29 +0000 (22:33 +0800)
committerFlorian Eckert <redacted>
Tue, 7 Jul 2026 06:02:21 +0000 (08:02 +0200)
The /usr/bin/ddns frontend did not support a version option, so
generic package tests treated it as an executable that could not report
the package version.

Read the installed version file and support -V/--version, matching the
version output style used by dynamic_dns_updater.sh.

Signed-off-by: Jiang Tengfei <redacted>
net/ddns-scripts/files/usr/bin/ddns.sh

index 921465f7e492480f4adec3257394a91250c1c18b..df47079a7579dde1c89a7070845d7a14883c1d7c 100644 (file)
@@ -33,6 +33,13 @@ usage() {
        exit "$code"
 }
 
+version() {
+       local version="unknown"
+
+       [ -f "${DDNS_PACKAGE_DIR}/version" ] && version="$(cat "${DDNS_PACKAGE_DIR}/version")"
+       printf '%s\n' "ddns-scripts ${version}"
+}
+
 action_update() {
        local cacert
 
@@ -160,6 +167,9 @@ main() {
        [ "$#" -eq 0 ] && usage "1"
 
        case "${cmd}" in
+               -V|--version)
+                       version
+                       ;;
                service)
                        sub_service "${action}" "${service}"
                        ;;
git clone https://git.99rst.org/PROJECT