-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.go
36 lines (34 loc) · 994 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
package main
import (
"github.com/Mmx233/BitSrunLoginGo/internal/config"
"github.com/Mmx233/BitSrunLoginGo/internal/controllers"
"github.com/Mmx233/BitSrunLoginGo/tools"
log "github.com/sirupsen/logrus"
)
func main() {
if config.Settings.Guardian.Enable {
//进入守护模式
controllers.Guardian()
} else {
//登录流程
var err error
if config.Settings.Basic.Interfaces == "" { //单网卡
if err = controllers.Login(nil, false); err != nil {
log.Errorln("登录出错: ", err)
if !config.Settings.Log.DebugLevel {
log.Infoln("开启调试日志(debug_level)获取详细信息")
}
return
}
} else { //多网卡
log.Infoln("多网卡模式")
interfaces, _ := tools.GetInterfaceAddr(config.Settings.Basic.Interfaces)
for _, eth := range interfaces {
log.Infoln("使用网卡: ", eth.Name)
if err = controllers.Login(ð, false); err != nil {
log.Errorf("网卡 %s 登录出错: %v", eth.Name, err)
}
}
}
}
}