mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
Bug fix
This commit is contained in:
parent
2f6c8c23e3
commit
8867c09db7
16
godns.go
16
godns.go
@ -64,21 +64,17 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
if err := LoadSettings(*optConf, &configuration); err != nil {
|
||||||
configuration, err = LoadSettings(*optConf)
|
|
||||||
|
|
||||||
err = InitLogger(configuration.Log_Path, configuration.Log_Size, configuration.Log_Num)
|
|
||||||
if err != nil {
|
|
||||||
log.Println("InitLogger error:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
log.Println(err.Error())
|
log.Println(err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := InitLogger(configuration.Log_Path, configuration.Log_Size, configuration.Log_Num); err != nil {
|
||||||
|
log.Println("InitLogger error:", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
dnsLoop()
|
dnsLoop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//Settings struct
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
Email string
|
Email string
|
||||||
Password string
|
Password string
|
||||||
@ -20,7 +21,7 @@ type Settings struct {
|
|||||||
Group int
|
Group int
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadSettings(config_path string) (Settings, error) {
|
func LoadSettings(config_path string, settings *Settings) error {
|
||||||
setting := Settings{}
|
setting := Settings{}
|
||||||
file, err := ioutil.ReadFile(config_path)
|
file, err := ioutil.ReadFile(config_path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user