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 (
|
||||
"database/sql"
|
||||
"flag"
|
||||
"strconv"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
|
@ -17,9 +18,13 @@ var DB *sql.DB
|
|||
|
||||
//Main loop
|
||||
func main() {
|
||||
//Get config patch
|
||||
configPatch := flag.String("config", "extra/config.ini.example", "the patch to the config file")
|
||||
flag.Parse()
|
||||
|
||||
//Load Configuration
|
||||
conf = new(utils.Conf)
|
||||
err := ini.MapTo(conf, "./config.ini")
|
||||
err := ini.MapTo(conf, *configPatch)
|
||||
utils.CheckErr(err)
|
||||
|
||||
utils.InitLogger(conf)
|
||||
|
|
Loading…
Reference in a new issue