simplify "need to run as root" condition
This commit is contained in:
1 parent
c2042d52f8
commit
363814db5c
1 file changed
+4
-5
@@ -72,16 +72,15 @@ exec_remote() {
|
|||||||
if [ "$1" = "--local" ]; then
|
if [ "$1" = "--local" ]; then
|
||||||
LOCAL="$1"
|
LOCAL="$1"
|
||||||
shift 1
|
shift 1
|
||||||
|
[ $(id -u) = 0 ] || {
|
||||||
|
echo "weave must be run as 'root' when run locally" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
elif [ "$1" != "run" ]; then
|
elif [ "$1" != "run" ]; then
|
||||||
exec_remote "$@"
|
exec_remote "$@"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ $(id -u) = 0 ] || ([ "$1" = "run" ] && [ -z "$LOCAL" ]) || {
|
|
||||||
echo "weave must be run as 'root' when run locally" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
CONTAINER_NAME=${WEAVE_CONTAINER_NAME:-weave}
|
CONTAINER_NAME=${WEAVE_CONTAINER_NAME:-weave}
|
||||||
DNS_CONTAINER_NAME=weavedns
|
DNS_CONTAINER_NAME=weavedns
|
||||||
BRIDGE=weave
|
BRIDGE=weave
|
||||||
|
|||||||
Reference in new issue
Block a user