Skip to content

Commit f3b7054

Browse files
committed
Pings with statistics only when host is up
1 parent 8710e33 commit f3b7054

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python2port.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ def checkHost(ip, port):
110110

111111
if ping == True:
112112
lst.append("PING SUCCESS")
113+
# Collect ping statistics only when the host is up
114+
lst.append(pingStatistics(ip))
113115
else:
114116
lst.append("PING FAIL")
115117
if ipup == True:
116118
lst.append("PORT OPEN")
117119
else:
118120
lst.append("PORT CLOSED")
119121

120-
lst.append(pingStatistics(ip))
121122
""" lst.append(ping)
122123
lst.append(ipup) """
123124
return lst

0 commit comments

Comments
 (0)