On Thu, 09 May 2024 19:39:36 +0200 Paolo Abeni wrote:
Acked-by: Paolo Abenipabeni@redhat.com
Thanks!
As a minor note, shell variable expansion should already trim all the trailing/leading spaces from the socat command output, so it should not be necessary replace the string comparison with the grep command:
RESULT6=$(ip netns exec "${LISTENER}" timeout 15 socat - UDP6-LISTEN:6000,readbytes=128 || true) if [ "$RESULT6" == "2001:db8:3::2" ]; then
99% sure I tried that exact thing, but it wasn't enough.
$ msg=$(socat - UDP4-LISTEN:1234,readbytes=128) $ echo ">$msg<"
127.0.0.1 <
$ msg=$msg $ echo ">$msg<"
127.0.0.1 <
$ msg=$(echo $msg) $ echo ">$msg<"
127.0.0.1<
IOW we'd need to feed it thru an echo or some such. Possibly something like: [ $(echo $msg) == "127.0.0.1" ] But I personally find that a touch too magical. The grep works 🤷️