Fix port not being set with command flag
This commit is contained in:
parent
0a4ff49cbb
commit
61dd64182e
8
main.go
8
main.go
|
@ -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 != "" {
|
||||
|
|
Loading…
Reference in New Issue