Added 'weave version' command per Issue #56
This commit is contained in:
1 parent
25c4adf68e
commit
87a4dee7ea
1 file changed
+12
@@ -8,6 +8,7 @@ usage() {
|
||||
echo "weave expose <ipaddr>/<subnet>"
|
||||
echo "weave hide <ipaddr>/<subnet>"
|
||||
echo "weave status"
|
||||
echo "weave version"
|
||||
echo "weave stop"
|
||||
exit 1
|
||||
}
|
||||
@@ -122,6 +123,17 @@ case "$COMMAND" in
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
version)
|
||||
# Try the running container first; if no luck try the image
|
||||
if ! DOCKERIMAGE=$(docker inspect --format='{{ .Image }}' weave 2>/dev/null) ; then
|
||||
if ! DOCKERIMAGE=$(docker inspect --format='{{ .Id }}' zettio/weave 2>/dev/null) ; then
|
||||
echo "Unable to find zettio/weave image." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
docker images --no-trunc | grep $DOCKERIMAGE | grep -v latest | tr -s ' ' | cut -d ' ' -f 2
|
||||
exit 0
|
||||
;;
|
||||
run)
|
||||
[ $# -gt 0 ] || usage
|
||||
IPADDR=$1
|
||||
|
||||
Reference in new issue
Block a user