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() {
|
||||
if _, err := net.EnsureInterface("ethwe", 20); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
_, err := net.EnsureInterface("ethwe", 20)
|
||||
checkErr(err)
|
||||
|
||||
if len(os.Args) <= 1 {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
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 {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
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