Fix #1001 set RTMP port from cli (#1038)

This commit is contained in:
leuc 2021-05-22 03:11:15 +02:00 committed by GitHub
parent a77af81684
commit ebf8157e8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,7 @@ func main() {
restoreDatabaseFile := flag.String("restoreDatabase", "", "Restore an Owncast database backup")
newStreamKey := flag.String("streamkey", "", "Set your stream key/admin password")
webServerPortOverride := flag.String("webserverport", "", "Force the web server to listen on a specific port")
rtmpPortOverride := flag.Int("rtmpport", 0, "Set listen port for the RTMP server")
flag.Parse()
@ -124,6 +125,12 @@ func main() {
config.WebServerPort = data.GetHTTPPortNumber()
// Set the rtmp server port
if *rtmpPortOverride > 0 {
log.Println("Saving new RTMP server port number to", *rtmpPortOverride)
data.SetRTMPPortNumber(float64(*rtmpPortOverride))
}
// starts the core
if err := core.Start(); err != nil {
log.Fatalln("failed to start the core package", err)