weavewait should exit if it times out
To match behaviour of proxy when interface fails to attach
This commit is contained in:
1 parent
0cb2e80e09
commit
4f73ef73bb
1 file changed
+8
-8
+8
-8
@@ -10,22 +10,22 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if _, err := net.EnsureInterface("ethwe", 20); err != nil {
|
_, err := net.EnsureInterface("ethwe", 20)
|
||||||
fmt.Fprintln(os.Stderr, err)
|
checkErr(err)
|
||||||
}
|
|
||||||
|
|
||||||
if len(os.Args) <= 1 {
|
if len(os.Args) <= 1 {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
binary, err := exec.LookPath(os.Args[1])
|
binary, err := exec.LookPath(os.Args[1])
|
||||||
|
checkErr(err)
|
||||||
|
|
||||||
|
checkErr(syscall.Exec(binary, os.Args[1:], os.Environ()))
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkErr(err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := syscall.Exec(binary, os.Args[1:], os.Environ()); err != nil {
|
|
||||||
fmt.Fprintln(os.Stderr, err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user