From 70cd381a910219e7f5dbc68128bed6daa7249203 Mon Sep 17 00:00:00 2001 From: emdee Date: Fri, 28 Oct 2022 02:57:32 +0000 Subject: [PATCH] Added Pings --- tox_profile.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tox_profile.py b/tox_profile.py index 5d72539..b652c12 100644 --- a/tox_profile.py +++ b/tox_profile.py @@ -775,13 +775,24 @@ def lNodesCheckNodes(json_nodes, oArgs, bClean=False): new_node['onions'] = [] for ipv in ['ipv4','ipv6']: - if not node[ipv] in lNONES: - LOG.info(f"Checking {node[ipv]}") for fam in ["status_tcp", "status_udp"]: if node[ipv] in lNONES \ and node[fam] in [True, "true"]: LOG.warn(f"{ipv} {node[ipv]} in [-, 'NONE'] but node[{fam}] is true") - if bHAVE_NMAP and bAreWeConnected and ts \ + bLinux = os.path.exists('/proc') + if bLinux and not os.path.exists(f"/proc/sys/net/{ipv}/"): + continue + elif True: + if not node[ipv] in lNONES and ipv == 'ipv4': + # just ping for now + iRet = os.system(f"ping -c 1 {node[ipv]} > /dev/null") + if iRet == 0: + LOG.info(f"Pinged {node[ipv]}") + else: + LOG.warn(f"Failed ping {node[ipv]}") + continue + elif not node[ipv] in lNONES \ + and bHAVE_NMAP and bAreWeConnected and ts \ and not bRUNNING_TOR \ and not node[ipv] in lNONES: # nmap test the ipv4/ipv6