Move use of command-line params to after we know them

This commit is contained in:
Bryan Boreham committed 2017-09-26 09:44:46 +00:00
1 parent eb88893312
commit e251bfe807
1 file changed
+5 -4
+5 -4
View File
@@ -211,10 +211,6 @@ func main() {
mflag.StringVar(&pluginConfig.MeshSocket, []string{"-plugin-mesh-socket"}, "/run/docker/plugins/weavemesh.sock", "plugin socket on which to listen in mesh mode")
proxyConfig := newProxyConfig(version, defaultDockerHost)
if bridgeConfig.AWSVPC {
proxyConfig.NoMulticastRoute = true
proxyConfig.KeepTXOn = true
}
// crude way of detecting that we probably have been started in a
// container, with `weave launch` --> suppress misleading paths in
@@ -231,6 +227,11 @@ func main() {
os.Exit(0)
}
if bridgeConfig.AWSVPC {
proxyConfig.NoMulticastRoute = true
proxyConfig.KeepTXOn = true
}
peers = mflag.Args()
if resume && len(peers) > 0 {
Log.Fatalf("You must not specify an initial peer list in conjunction with --resume")