Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions find_veth_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ": <VETH>:", only the right line will be found
Expand All @@ -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
Expand Down