Initial euclide.org release

This commit is contained in:
2023-11-17 06:55:06 +01:00
commit 97379c8e8a
210 changed files with 32403 additions and 0 deletions

38
main.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
"flag"
"log"
"log/syslog"
"os"
)
func main() {
var err error
// default configuration file is /etc/pdns-proxy.conf
configFile := flag.String("config", "/etc/pdns-proxy.conf", "configuration file")
logToSyslog := flag.Bool("syslog", false, "Log to syslog")
debug := flag.Bool("debug", false, "log every message received")
flag.Parse()
// in the production environnement, redirect every lgo() call to syslog
if *logToSyslog {
log.SetFlags(0)
logWriter, e := syslog.New(syslog.LOG_NOTICE, "pdnsProxy")
if e == nil {
log.SetOutput(logWriter)
defer logWriter.Close()
}
}
h, err := loadConfig(*configFile)
if err != nil {
log.Println(err)
os.Exit(1)
}
if *debug {
h.Debug()
}
h.Run()
}