Merge branch '1.0'
This commit is contained in:
commit
b72b7a9ed5
1 file changed
+5
-11
+5
-11
@@ -2,12 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/weaveworks/weave/net"
|
"github.com/weaveworks/weave/net"
|
||||||
)
|
)
|
||||||
@@ -16,20 +14,16 @@ func main() {
|
|||||||
if len(os.Args) <= 1 {
|
if len(os.Args) <= 1 {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
args := os.Args[1:]
|
args := os.Args[1:]
|
||||||
signalWait := time.Duration(math.MaxInt64)
|
|
||||||
if args[0] == "-s" {
|
if args[0] == "-s" {
|
||||||
signalWait = 0
|
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
|
} else {
|
||||||
|
usr2 := make(chan os.Signal)
|
||||||
|
signal.Notify(usr2, syscall.SIGUSR2)
|
||||||
|
<-usr2
|
||||||
}
|
}
|
||||||
|
|
||||||
usr2 := make(chan os.Signal)
|
|
||||||
signal.Notify(usr2, syscall.SIGUSR2)
|
|
||||||
select {
|
|
||||||
case <-usr2:
|
|
||||||
case <-time.After(signalWait):
|
|
||||||
}
|
|
||||||
_, err := net.EnsureInterface("ethwe", -1)
|
_, err := net.EnsureInterface("ethwe", -1)
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user