From 982f4957ab1a5b729446b9d62a33a89f74b1c51b Mon Sep 17 00:00:00 2001 From: benok Date: Wed, 18 Jun 2025 19:12:39 +0900 Subject: [PATCH 1/2] Trim netmask suffix from bridge ip --- find_veth_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find_veth_docker.sh b/find_veth_docker.sh index 4f10cf6..8e02f30 100755 --- a/find_veth_docker.sh +++ b/find_veth_docker.sh @@ -125,7 +125,7 @@ do bridge_ip="N/A" bridge_mac="N/A" else - bridge_ip=$(sudo ip a |grep $bridge |grep inet|awk '{print $2}') + bridge_ip=$(sudo ip a |grep $bridge |grep inet|awk '{print $2}'|sed 's!/[0-9]*!!') #colons are super important below, without them, grep would find the veth interfaces as well that are connected to the bridge #by grepping on the ": :", only the right line will be found From 720dfde0466d4bb511618851d3f35192949d4233 Mon Sep 17 00:00:00 2001 From: benok Date: Wed, 18 Jun 2025 19:13:47 +0900 Subject: [PATCH 2/2] Adjust tab count --- find_veth_docker.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/find_veth_docker.sh b/find_veth_docker.sh index 8e02f30..69f4f07 100755 --- a/find_veth_docker.sh +++ b/find_veth_docker.sh @@ -140,10 +140,14 @@ do # get the number of chars of the container name num_chars_name=${#i} extra_tab="" - if [ $num_chars_name -lt 7 ] + if [ $num_chars_name -lt 8 ] then extra_tab="\t" fi + if [ $num_chars_name -lt 16 ] + then + extra_tab="$extra_tab\t" + fi if [ "$bridge" == "docker0" ] then