diff --git a/find_veth_docker.sh b/find_veth_docker.sh index 4f10cf6..b54f4ac 100755 --- a/find_veth_docker.sh +++ b/find_veth_docker.sh @@ -89,7 +89,7 @@ do # #using the PID, we can get the interface index of the eth0 interfae inside the container # INDEX=$(sudo cat /proc/$PID/net/igmp |grep "$INTF"| awk '{print $1}') # #using the index, we can identify the veth interface - veth=$(sudo ip a|grep "${INDEX} veth"|awk '{print $2}'|cut -d '@' -f 1) + veth=$(sudo ip a|grep -e "^${INDEX} veth"|awk '{print $2}'|cut -d '@' -f 1) if [[ -z $veth ]] then veth="N/A\t" #add extra Tabs straight away for prettify