fix: go2rtc config path absolute, gitignore generated file
This commit is contained in:
parent
872c8c2273
commit
c4c9049e24
3 changed files with 4 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
nextnvr
|
nextnvr
|
||||||
|
go2rtc.yaml
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ func (g *Go2RTCManager) Start(cameras []CameraConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch go2rtc as a child process.
|
// Launch go2rtc as a child process.
|
||||||
g.cmd = exec.Command(g.config.Binary, "-config", "go2rtc.yaml")
|
g.cmd = exec.Command(g.config.Binary, "-config", "/opt/nextnvr/go2rtc.yaml")
|
||||||
g.cmd.Stdout = os.Stdout
|
g.cmd.Stdout = os.Stdout
|
||||||
g.cmd.Stderr = os.Stderr
|
g.cmd.Stderr = os.Stderr
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ func (g *Go2RTCManager) monitor() {
|
||||||
|
|
||||||
g.mu.Lock()
|
g.mu.Lock()
|
||||||
if g.running {
|
if g.running {
|
||||||
g.cmd = exec.Command(g.config.Binary, "-config", "go2rtc.yaml")
|
g.cmd = exec.Command(g.config.Binary, "-config", "/opt/nextnvr/go2rtc.yaml")
|
||||||
g.cmd.Stdout = os.Stdout
|
g.cmd.Stdout = os.Stdout
|
||||||
g.cmd.Stderr = os.Stderr
|
g.cmd.Stderr = os.Stderr
|
||||||
if startErr := g.cmd.Start(); startErr != nil {
|
if startErr := g.cmd.Start(); startErr != nil {
|
||||||
|
|
@ -144,5 +144,5 @@ func (g *Go2RTCManager) writeConfig(cameras []CameraConfig) error {
|
||||||
sb.WriteString(fmt.Sprintf(" %s_main: %s\n", cam.ID, mainURL))
|
sb.WriteString(fmt.Sprintf(" %s_main: %s\n", cam.ID, mainURL))
|
||||||
}
|
}
|
||||||
|
|
||||||
return os.WriteFile("go2rtc.yaml", []byte(sb.String()), 0600)
|
return os.WriteFile("/opt/nextnvr/go2rtc.yaml", []byte(sb.String()), 0600)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# go2rtc configuration — generated by NextNVR
|
|
||||||
api:
|
|
||||||
listen: ":1984"
|
|
||||||
|
|
||||||
streams:
|
|
||||||
Loading…
Reference in a new issue