nicer error message on 'weave status' when there is no weave container.

This commit is contained in:
Matthias Radestock committed 2014-09-11 07:15:15 +01:00
1 parent 96766db5f0
commit dbbb8c690a
1 file changed
+4 -1
+4 -1
View File
@@ -87,7 +87,10 @@ case "$COMMAND" in
IFACE=eth0
;;
status)
DOCKERIP=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' weave)
if ! DOCKERIP=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' weave 2>/dev/null) ; then
echo "There is no weave container." >&2
exit 1
fi
if [ -z "$DOCKERIP" ] ; then
echo "The weave container is not running." >&2
exit 1