From 180c142964465def77b8ddc9a12af46745ce243a Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 29 Aug 2014 16:12:44 +0100 Subject: [PATCH] move the most important check first --- weaver/weave | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weaver/weave b/weaver/weave index e5a7a27c..a06b3d08 100755 --- a/weaver/weave +++ b/weaver/weave @@ -8,6 +8,11 @@ usage() { exit 1 } +[ `id -u` = 0 ] || { + echo "weave must be run as 'root'" + exit 1 +} + [ $# -gt 1 ] || usage BRIDGE=weave @@ -20,11 +25,6 @@ IPADDR=$2 shift 2 -[ `id -u` = 0 ] || { - echo "weave must be run as 'root'" - exit 1 -} - # pre-create bridge so we can set the MTU [ ! -d /sys/class/net/$BRIDGE ] && { ip link add dev $BRIDGE type bridge