-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
42 lines (37 loc) · 914 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"github.com/codegangsta/cli"
"github.com/davecheney/profile"
"os"
)
func init() {
// daemon.Initialize()
}
func main() {
defer profile.Start(profile.CPUProfile).Stop()
app := cli.NewApp()
app.Name = "simple ovs driver"
app.Usage = "ovs driver used an create bridge and attach netns to the bridge"
app.Version = "0.1.0"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "configfile",
Value: "/etc/network/simple_ovs_driver.config",
Usage: "Name of the configuration file",
},
}
app.Action = Run
app.Run(os.Args)
}
func Run(ctx *cli.Context) {
println("Using configuration file: ", ctx.String("configfile"))
configFilename := ctx.String(config.CFG_FILE)
err := config.Parse(configFilename)
if err != nil {
log.Fatal("Unable to parse configuration file " + configFilename)
os.Exit(1)
}
// d := daemon.NewDaemon()
// d.Run(ctx)
println("...Run() done.")
}