Skip to content

Commit

Permalink
Rename config file for sources
Browse files Browse the repository at this point in the history
  • Loading branch information
vvidic committed Jul 19, 2020
1 parent fb82bb4 commit 273465c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mjpeg-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ type configSource struct {
Url string
}

func loadConfig(config string) error {
file, err := os.Open(config)
func loadConfig(filename string) error {
file, err := os.Open(filename)
if err != nil {
return err
}
Expand Down Expand Up @@ -458,13 +458,13 @@ func main() {
username := flag.String("username", "", "source mjpg username")
password := flag.String("password", "", "source mjpg password")
url := flag.String("uri", "/", "proxy serve uri")
config := flag.String("config", "", "JSON configuration file to load")
sources := flag.String("sources", "", "JSON configuration file to load sources from")
bind := flag.String("bind", ":8080", "proxy bind address")
flag.Parse()

var err error
if *config != "" {
err = loadConfig(*config)
if *sources != "" {
err = loadConfig(*sources)
} else {
err = startSource(*source, *username, *password, *url)
}
Expand Down
File renamed without changes.

0 comments on commit 273465c

Please sign in to comment.