Skip to content

Commit

Permalink
New rewritten version of network.py, issue #42
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsilverm committed Dec 22, 2019
1 parent fd4d3ee commit 60aa0f7
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 678 deletions.
20 changes: 12 additions & 8 deletions nbmdt_simple.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

# From jeffs-windows-laptop


from typing import List
import network
import subprocess
from time import sleep


INET="-4"
INET6="-6"


BORDER_GATEWAY_4 = "96.120.102.161"
BORDER_GATEWAY_6 = "2001:558:4082:5c::1"

network_obj = network.Network()


def main():
default_gateway_4 = get_default_gateway(INET)
Expand All @@ -25,9 +31,8 @@ def main():
verify_ping_6 = ping(default_gateway_6, INET6`)
report("IPv6 default gateway pingable", green=(verify_ping_6 == 1.0), yellow=(verify_ping_6 < 1.0 and verify_ping_4 > 0.0), red = (verify_ping_4 == 0.0) )

def ping(host, protocol):

def report(explanation: str="Not specified", red: bool =False, yellow:
def report(explanation: str="Not specified", red: bool =False, yellow:
bool =False, green: bool =False):
"""
explanation: str A descriptive string
Expand All @@ -42,11 +47,10 @@ def report(explanation: str="Not specified", red: bool =False, yellow:
"UNKNOWN") ) )
print(f"{explanation}: {status}")

def ping(


if "__main__" == __name__:
while True do:
main()
time.sleep(10)

if "__main__" == __name__:
while True:
main()
sleep(10)
Loading

0 comments on commit 60aa0f7

Please sign in to comment.