Try to read config from under /etc (#18)

This commit is contained in:
Joona Hoikkala
2017-11-14 00:42:30 +02:00
committed by GitHub
parent 9c639223ce
commit 9c54da3ee6
7 changed files with 41 additions and 28 deletions

11
util.go
View File

@ -3,14 +3,23 @@ package main
import (
"crypto/rand"
"math/big"
"os"
"regexp"
"strings"
"github.com/BurntSushi/toml"
log "github.com/sirupsen/logrus"
"github.com/miekg/dns"
log "github.com/sirupsen/logrus"
)
func fileExists(fname string) bool {
_, err := os.Stat(fname)
if err != nil {
return false
}
return true
}
func readConfig(fname string) DNSConfig {
var conf DNSConfig
// Practically never errors