Skip to content

Commit

Permalink
check again to get correct ip and port
Browse files Browse the repository at this point in the history
  • Loading branch information
giloser committed Feb 1, 2021
1 parent 2597c8c commit 256131b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octoprint_telegram/telegramCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def cmdSys(self,chat_id,from_id,cmd,parameter):
else:
message_text = " No known System Commands."
try:
self._logger.info("IP: " + str(self.main._settings.global_get(["server","onlineCheck","host"])) +":" +str(self.main._settings.global_get(["server","onlineCheck","port"]) ))
self._logger.info("IP: " + str(self.main._settings.global_get(["server","host"])) +":" +str(self.main._settings.global_get(["server","port"]) ))
server_ip = [(s.connect((self.main._settings.global_get(["server","onlineCheck","host"]), self.main._settings.global_get(["server","onlineCheck","port"]))), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]
message_text += "\n\nIP: " + server_ip
except Exception as ex: self._logger.error("Exception retrieving IP address: " + str(ex))
Expand Down

0 comments on commit 256131b

Please sign in to comment.