From c037c66fc6a0779a3b5b278bf0d5c85c4f9a00d8 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 9 Jul 2020 23:02:01 -0400 Subject: [PATCH] Add rcon host configuration --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index afb2ed9..69a78c3 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,13 @@ func main() { events.On(events.Message, handleCommands) - client = rcon.NewSession("localhost", rconPort, rconPassword) + rconHost := "localhost" + + if envHost := os.Getenv("RCON_HOST"); envHost != "" { + rconHost = envHost + } + + client = rcon.NewSession(rconHost, rconPort, rconPassword) client.Debug = debug