Permalink
Browse files

Support base configuration file outside the zone config directory

(And allow the filename to be specified)
  • Loading branch information...
abh committed Nov 14, 2016
1 parent ad745c7 commit 4980e99cdebff6c6f3350ea2ac51926c1302b2d8
Showing with 8 additions and 1 deletion.
  1. +8 −1 geodns.go
View
@@ -53,6 +53,7 @@ var timeStarted = time.Now()
var (
flagconfig = flag.String("config", "./dns/", "directory of zone files")
flagconfigfile = flag.String("configfile", "geodns.conf", "filename of config file (in 'config' directory)")
flagcheckconfig = flag.Bool("checkconfig", false, "check configuration and exit")
flagidentifier = flag.String("identifier", "", "identifier (hostname, pop name or similar)")
flaginter = flag.String("interface", "*", "set the listener address")
@@ -109,7 +110,13 @@ func main() {
}
}
configFileName := filepath.Clean(*flagconfig + "/geodns.conf")
var configFileName string
if filepath.IsAbs(*flagconfigfile) {
configFileName = *flagconfigfile
} else {
configFileName = filepath.Clean(filepath.Join(*flagconfig, *flagconfigfile))
}
if *flagcheckconfig {
dirName := *flagconfig

0 comments on commit 4980e99

Please sign in to comment.