|
@@ -8,26 +8,17 @@ import (
|
|
|
"os/signal"
|
|
|
"time"
|
|
|
|
|
|
+ "git.lattuga.net/boyska/direttoforo"
|
|
|
"git.lattuga.net/boyska/direttoforo/liquidsoap"
|
|
|
"git.lattuga.net/boyska/direttoforo/uiserver"
|
|
|
)
|
|
|
|
|
|
-type State struct {
|
|
|
- Streams map[string]liquidsoap.Stream
|
|
|
-}
|
|
|
-
|
|
|
-func NewState() State {
|
|
|
- s := State{}
|
|
|
- s.Streams = make(map[string]liquidsoap.Stream)
|
|
|
- return s
|
|
|
-}
|
|
|
-
|
|
|
func main() {
|
|
|
liqfile := flag.String("liq", "foo.liq", "Path to liquidsoap script to run")
|
|
|
bindpath := flag.String("bindpath", "/var/lib/direttoforo/ui.sock", "UNIX domain socket path for UIs")
|
|
|
flag.Parse()
|
|
|
|
|
|
- state := NewState()
|
|
|
+ state := direttoforo.NewState()
|
|
|
|
|
|
netUIsock, err := net.Listen("unix", *bindpath)
|
|
|
if err != nil {
|
|
@@ -74,7 +65,9 @@ func main() {
|
|
|
t.Conn.SetDeadline(time.Now().Add(3 * time.Second))
|
|
|
outs, err := t.Outputs()
|
|
|
if err != nil {
|
|
|
- fmt.Println("telnet cmd errored", err)
|
|
|
+ if err.Error() != "EOF" {
|
|
|
+ fmt.Println("telnet cmd errored", err)
|
|
|
+ }
|
|
|
continue
|
|
|
}
|
|
|
changed := false
|