diff --git a/find_veth_docker.sh b/find_veth_docker.sh index 4f10cf6..69f4f07 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 @@ -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