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.
This commit is contained in:
Louis Opter 2013-04-10 17:40:28 -07:00
parent e41fd24542
commit 5e1a975b48
1 changed files with 1 additions and 2 deletions

View File

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