mwan3: common.sh: fix sed syntax for GNU sed
authorFabian Groffen <[email protected]>
Tue, 2 Sep 2025 11:19:55 +0000 (13:19 +0200)
committerFlorian Eckert <[email protected]>
Wed, 3 Sep 2025 13:42:20 +0000 (15:42 +0200)
`pq' yields with GNU sed:
  sed: -e expression #1, char 15: extra characters after command
so, make q a separate command instead.

busybox accepts this too, and still returns only the first match (q
quits processing)

Signed-off-by: Fabian Groffen <[email protected]>
net/mwan3/files/lib/mwan3/common.sh

index b99ccfd0e89b9173e497573bb32c21cff175512b..8b4adbdf08ba2cc38d9ea433f86b6f4fcc6f6d36 100644 (file)
@@ -63,12 +63,12 @@ mwan3_get_src_ip()
        if [ "$family" = "ipv4" ]; then
                addr_cmd='network_get_ipaddr'
                default_ip="0.0.0.0"
-               sed_str='s/ *inet \([^ \/]*\).*/\1/;T; pq'
+               sed_str='s/ *inet \([^ \/]*\).*/\1/;T;p;q'
                IP="$IP4"
        elif [ "$family" = "ipv6" ]; then
                addr_cmd='network_get_ipaddr6'
                default_ip="::"
-               sed_str='s/ *inet6 \([^ \/]*\).* scope.*/\1/;T; pq'
+               sed_str='s/ *inet6 \([^ \/]*\).* scope.*/\1/;T;p;q'
                IP="$IP6"
        fi