1
0
mirror of https://github.com/rancher/os.git synced 2025-06-24 14:01:34 +00:00
os/cmd/network/network.go

27 lines
455 B
Go
Raw Normal View History

2015-03-02 23:03:21 +00:00
package network
import (
"fmt"
"os"
log "github.com/Sirupsen/logrus"
2015-07-29 07:45:06 +00:00
"github.com/rancher/netconf"
2015-03-02 23:03:21 +00:00
"github.com/rancherio/os/config"
)
func Main() {
args := os.Args
if len(args) > 1 {
fmt.Println("call " + args[0] + " to load network config from cloud-config.yml")
2015-03-02 23:03:21 +00:00
return
}
cfg, err := config.LoadConfig()
if err != nil {
log.Fatal(err)
}
2015-07-29 07:45:06 +00:00
if err := netconf.ApplyNetworkConfigs(&cfg.Rancher.Network); err != nil {
log.Fatal(err)
2015-03-02 23:03:21 +00:00
}
}