Configuration file patch is dynamic
This commit is contained in:
parent
c858b1b5e1
commit
44147b07f2
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"flag"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
|
@ -17,9 +18,13 @@ var DB *sql.DB
|
||||||
|
|
||||||
//Main loop
|
//Main loop
|
||||||
func main() {
|
func main() {
|
||||||
|
//Get config patch
|
||||||
|
configPatch := flag.String("config", "extra/config.ini.example", "the patch to the config file")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
//Load Configuration
|
//Load Configuration
|
||||||
conf = new(utils.Conf)
|
conf = new(utils.Conf)
|
||||||
err := ini.MapTo(conf, "./config.ini")
|
err := ini.MapTo(conf, *configPatch)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
|
|
||||||
utils.InitLogger(conf)
|
utils.InitLogger(conf)
|
||||||
|
|
Loading…
Reference in a new issue