summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/rhimportd.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd/rhimportd.go')
-rw-r--r--src/helsinki.at/rhimportd/rhimportd.go16
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)