David K. Bainbridge | f307101 | 2016-08-04 09:29:55 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
2 | |||||
3 | test $# -ne 1 && echo "must specify the name of a container" && exit 1 | ||||
4 | |||||
5 | IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $1) | ||||
6 | |||||
7 | if [ "$IP x" == " x" ]; then | ||||
8 | IP=$(docker inspect --format '{{.NetworkSettings.Networks.maas_default.IPAddress}}' $1) | ||||
9 | fi | ||||
10 | |||||
11 | /bin/echo -ne $IP |