-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsyler.go
38 lines (34 loc) · 824 Bytes
/
syler.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
package main
import (
"flag"
"fmt"
toml "github.com/extrame/go-toml-config"
"github.com/extrame/syler/component"
"github.com/extrame/syler/config"
"path/filepath"
)
func main() {
//http server
//radius avp server
//radius accounting server
// go func() {
// res, err := v1.Challenge(net.IPv4(192, 168, 10, 254), *config.PortalSecret, net.IPv4(192, 168, 56, 2))
// }()
path := flag.String("config", "./syler.conf", "设置配置文件的路径")
component.InitBasic()
flag.Parse()
*path = filepath.FromSlash(*path)
if err := toml.Parse(*path); err == nil {
if config.IsValid() {
component.InitLogger()
go component.StartHuawei()
if *config.RadiusEnable {
go component.StartRadiusAuth()
go component.StartRadiusAcc()
}
component.StartHttp()
}
} else {
fmt.Println(err)
}
}