moved chdir after config loaded
This commit is contained in:
parent
931c065c8f
commit
f0eca13294
10
coolDns.go
10
coolDns.go
@ -384,16 +384,16 @@ func main() {
|
||||
configPath := flag.String("c", "/etc/cool-dns/config.yaml", "path to the config file")
|
||||
flag.Parse()
|
||||
|
||||
err := os.Chdir(filepath.Dir(*configPath))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to goto config dir: %s", err.Error())
|
||||
}
|
||||
|
||||
config, err := loadConfig(*configPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load config: %s\n", err.Error())
|
||||
}
|
||||
|
||||
err = os.Chdir(filepath.Dir(*configPath))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to goto config dir: %s", err.Error())
|
||||
}
|
||||
|
||||
zones, err := loadZones(config.Zones)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load zones: %s\n", err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user