From e287110099093174f3a98c5300abf4a19d44d916 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 17 Sep 2014 06:46:02 +0100 Subject: [PATCH] improve error messages and make sure they all go to stderr ...since otherwise they get hidden when the output is redirected, e.g. in the typical # C=$(weave run ...) invocation. --- weaver/weave | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weaver/weave b/weaver/weave index 77a28173..8ba2b3ac 100755 --- a/weaver/weave +++ b/weaver/weave @@ -21,7 +21,7 @@ command_exists () { } [ `id -u` = 0 ] || { - echo "weave must be run as 'root'" + echo "weave must be run as 'root'" >&2 exit 1 } @@ -104,11 +104,11 @@ stop_masquerading() { configure_container_networking() { DOCKERPID=$(docker inspect --format='{{ .State.Pid }}' $1) [ "$DOCKERPID" = 0 ] && { - echo "Docker inspect returned invalid PID 0" + echo "Container $1 not running." >&2 exit 1 } [ "$DOCKERPID" = "" ] && { - echo "Container $1 unknown to Docker." + echo "Container $1 unknown to Docker." >&2 exit 1 } NSPID=$DOCKERPID @@ -241,7 +241,7 @@ case "$COMMAND" in destroy_bridge ;; *) - echo "Unknown weave command '$COMMAND'" + echo "Unknown weave command '$COMMAND'" >&2 usage ;; esac