Skip to content

Instantly share code, notes, and snippets.

@gebv
Last active September 14, 2021 04:55
Show Gist options
  • Save gebv/02c7e54ad81eae79eb94c1e55055eb13 to your computer and use it in GitHub Desktop.
Save gebv/02c7e54ad81eae79eb94c1e55055eb13 to your computer and use it in GitHub Desktop.
Get pair network interface to container name
#!/bin/bash
NAME=$1
IFACE=eth0
ip a|grep "if`docker exec ${NAME} ip a|grep ${IFACE}@|cut -d ':' -f 1`"|cut -d ":" -f 2|cut -d '@' -f 1|sed "s/ //g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment