Skip to content

Commit

Permalink
Merge pull request #16 from jonfairbanks/develop
Browse files Browse the repository at this point in the history
Error Handling
  • Loading branch information
jonfairbanks authored May 11, 2021
2 parents d7a5d41 + fdcd558 commit 9e95b22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion octoprint_NetworkHealth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def default_gateway(self):

def check_ping(self):
hostname = self.default_gateway()
if hostname is None:
self._logger.info("Failed to determine default gateway; using 8.8.8.8 instead...")
hostname = "8.8.8.8"
response = os.system("ping -c 4 " + hostname)
if response == 0:
return True
Expand All @@ -59,7 +62,7 @@ def check_ping(self):


__plugin_name__ = "Network Health Monitor"
__plugin_version__ = "1.0.3"
__plugin_version__ = "1.0.4"
__plugin_description__ = "Monitors the health of the Network connection and restarts it if necessary"
__plugin_pythoncompat__ = ">=2.7,<4"

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
plugin_identifier = "networkhealth"
plugin_package = "octoprint_NetworkHealth"
plugin_name = "OctoPrint-NetworkHealth"
plugin_version = "1.0.3"
plugin_version = "1.0.4"
plugin_description = """Monitors the health of the Network connection and restarts it if necessary"""
plugin_author = "Jon Fairbanks"
plugin_author_email = "jon@fairbanks.io"
Expand Down

0 comments on commit 9e95b22

Please sign in to comment.