]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEV: flags/show-fd-to-flags: adapt to recent versions
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jun 2024 09:05:08 +0000 (11:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Jun 2024 06:13:24 +0000 (08:13 +0200)
The script hadn't been updated since it was introduced, and the
hard-coded field 12 doesn't match anymore (it's 16 now). Let's just
use "grep -o cflg..." to extract the desired part more flexibly.
This can be backported at least to 3.0, probably further, but it
will need to be tested prior to this. Better not bring it too far,
it's only used when debugging.

dev/flags/show-fd-to-flags.sh

index 29757c3204771cb2c6311e340d5f038d7ca0b48d..2ee9e379bb9d22c87162d201608de69882ad0252 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/sh
-awk '{print $12}' | grep cflg= | sort | uniq -c | sort -nr | while read a b; do c=${b##*=}; d=$(${0%/*}/flags conn $c);d=${d##*= }; printf "%6d %s    %s\n" $a "$b" "$d";done
+grep -o 'cflg=[0-9a-fx]*' | sort | uniq -c | sort -nr | while read a b; do c=${b##*=}; d=$(${0%/*}/flags conn $c);d=${d##*= }; printf "%6d %s    %s\n" $a "$b" "$d";done