diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-04 00:26:12 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-04 00:26:12 (GMT) |
commit | 80c19f00f3b098621fe5bb8f42c009f2890e84f8 (patch) | |
tree | aedaa9ff503802941c4539f8a2d9d1b4a5a1115a /src/helsinki.at/rhimportd/rhimportd.go | |
parent | ece69efd67af2982cac882b9192872c7ff6957bb (diff) |
introduced conf
Diffstat (limited to 'src/helsinki.at/rhimportd/rhimportd.go')
-rw-r--r-- | src/helsinki.at/rhimportd/rhimportd.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/helsinki.at/rhimportd/rhimportd.go b/src/helsinki.at/rhimportd/rhimportd.go index b73df95..7fb62b6 100644 --- a/src/helsinki.at/rhimportd/rhimportd.go +++ b/src/helsinki.at/rhimportd/rhimportd.go @@ -26,6 +26,7 @@ package main import ( "flag" + "helsinki.at/rhimport" "os" "os/signal" "sync" @@ -33,6 +34,8 @@ import ( func main() { addr_s := flag.String("addr", ":4000", "addr:port to listen on, default: ':4000'") + rdconf_s := flag.String("rdconf", "/etc/rd.conf", "path to the Rivendell config file, default: '/etc/rd.conf'") + rdxport_url_s := flag.String("rdxport-url", "http://localhost/rd-bin/rdxport.cgi", "the url to the Rivendell web-api, default: 'http://localhost/rd-bin/rdxport.cgi'") help := flag.Bool("help", false, "show usage") flag.Parse() @@ -41,14 +44,21 @@ func main() { return } + conf, err := rhimport.NewConfig(rdconf_s, rdxport_url_s) + if err != nil { + rhl.Println("Error reading configuration:", err) + return + } + defer conf.Cleanup() + var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() - rhl.Println("start web-srv") - StartControlWeb(*addr_s) - rhl.Println("web finished") + rhl.Println("start web-ctrl") + StartControlWeb(*addr_s, conf) + rhl.Println("web-ctrl finished") }() alldone := make(chan bool) |