From adbd4b72961a0d06005e7ee69ddac3aa770803f1 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Sat, 1 Apr 2023 20:06:43 +0200 Subject: [PATCH] fix compatibility between confwatcher and legacy configuration file (#1642) --- internal/confwatcher/confwatcher.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/confwatcher/confwatcher.go b/internal/confwatcher/confwatcher.go index c35524ab..85b003e9 100644 --- a/internal/confwatcher/confwatcher.go +++ b/internal/confwatcher/confwatcher.go @@ -27,7 +27,14 @@ type ConfWatcher struct { // New allocates a ConfWatcher. func New(confPath string) (*ConfWatcher, error) { if _, err := os.Stat(confPath); err != nil { - return nil, err + if confPath == "mediamtx.yml" { + confPath = "rtsp-simple-server.yml" + if _, err := os.Stat(confPath); err != nil { + return nil, err + } + } else { + return nil, err + } } inner, err := fsnotify.NewWatcher()