@@ -24,10 +24,11 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
BasicConf struct {
|
BasicConf struct {
|
||||||
Https bool `json:"https" yaml:"https"`
|
Https bool `json:"https" yaml:"https"`
|
||||||
SkipCertVerify bool `json:"skip_cert_verify" yaml:"skip_cert_verify"`
|
SkipCertVerify bool `json:"skip_cert_verify" yaml:"skip_cert_verify"`
|
||||||
Timeout uint `json:"timeout" yaml:"timeout"`
|
Timeout uint `json:"timeout" yaml:"timeout"`
|
||||||
Interfaces string `json:"interfaces" yaml:"interfaces"`
|
Interfaces string `json:"interfaces" yaml:"interfaces"`
|
||||||
|
InterfacesInterval uint `json:"interfaces_interval" yaml:"interfaces_interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
LogConf struct {
|
LogConf struct {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/Mmx233/BitSrunLoginGo/tools"
|
"github.com/Mmx233/BitSrunLoginGo/tools"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ipLast string
|
var ipLast string
|
||||||
@@ -53,13 +54,17 @@ func LoginInterfaces() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
var interval = time.Duration(config.Settings.Basic.InterfacesInterval) * time.Second
|
||||||
var errCount int
|
var errCount int
|
||||||
for _, eth := range interfaces {
|
for i, eth := range interfaces {
|
||||||
logger.Infoln("使用网卡: ", eth.Name)
|
logger.Infoln("使用网卡: ", eth.Name)
|
||||||
if err := LoginSingle(ð, false); err != nil {
|
if err := LoginSingle(ð, false); err != nil {
|
||||||
config.Logger.Errorf("网卡 %s 登录出错: %v", eth.Name, err)
|
config.Logger.Errorf("网卡 %s 登录出错: %v", eth.Name, err)
|
||||||
errCount++
|
errCount++
|
||||||
}
|
}
|
||||||
|
if i != len(interfaces)-1 {
|
||||||
|
time.Sleep(interval)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if errCount > 0 {
|
if errCount > 0 {
|
||||||
return errors.New("multi interface login not completely succeed")
|
return errors.New("multi interface login not completely succeed")
|
||||||
|
|||||||
Reference in New Issue
Block a user