diff --git a/revid/RevidInstance.go b/revid/RevidInstance.go index 8d0ebc9c..77f6d98c 100644 --- a/revid/RevidInstance.go +++ b/revid/RevidInstance.go @@ -327,6 +327,12 @@ func (r *revidInst) packClips() { } } +func reboot() { + cmd := exec.Command("sudo", "reboot") + err := cmd.Run() + fmt.Println("Rebooting!") +} + // outputClips takes the clips produced in the packClips method and outputs them // to the desired output defined in the revidInst config func (r *revidInst) outputClips() { @@ -352,6 +358,9 @@ func (r *revidInst) outputClips() { bytes += len(clip) for err := r.sendClip(clip); err != nil; { r.Log(Error, err.Error()) + if sendClip == sendClipToLibRtmp { + reboot() + } if len(clip) >= 11 { r.Log(Warning, "Send failed trying again!") err = r.sendClip(clip)