Fix port not being set with command flag

This commit is contained in:
joeyak 2019-05-05 13:35:36 -04:00
parent 0a4ff49cbb
commit 61dd64182e
1 changed files with 6 additions and 2 deletions

View File

@ -40,7 +40,7 @@ func setupSettings() error {
}
func main() {
flag.StringVar(&addr, "l", ":8089", "host:port of the MovieNight")
flag.StringVar(&addr, "l", "", "host:port of the MovieNight")
flag.StringVar(&sKey, "k", "", "Stream key, to protect your stream")
flag.Parse()
@ -66,10 +66,14 @@ func main() {
os.Exit(1)
}
if addr != "" {
if addr == "" {
addr = settings.ListenAddress
}
if addr[0] != ':' {
addr = ":" + addr
}
// A stream key was passed on the command line. Use it, but don't save
// it over the stream key in the settings.json file.
if sKey != "" {