Skip to content

Instantly share code, notes, and snippets.

@a60814billy
Created January 24, 2015 17:38
Show Gist options
  • Save a60814billy/571f03aeef5cd2cb5317 to your computer and use it in GitHub Desktop.
Save a60814billy/571f03aeef5cd2cb5317 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $0 container_id"
exit 0
fi
result="`sudo docker exec "$1" ifconfig | grep -A1 eth0 | awk {'print $2'}`"
echo $result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment