Explorar el Código

Use ip to setup the gateway in sysinit.go

ip from iproute2 replaces the legacy route tool which is often not
installed by default on recent Linux distributions.

The same patch has been done in network.go and is re-used here.
Louis Opter hace 12 años
padre
commit
5e1a975b48
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      sysinit.go

+ 1 - 2
sysinit.go

@@ -17,8 +17,7 @@ func setupNetworking(gw string) {
 	if gw == "" {
 		return
 	}
-	cmd := exec.Command("/sbin/route", "add", "default", "gw", gw)
-	if err := cmd.Run(); err != nil {
+	if _, err := ip("route", "add", "default", "via", gw); err != nil {
 		log.Fatalf("Unable to set up networking: %v", err)
 	}
 }