Skip to content

Commit b72fe80

Browse files
committed
Fixed output logic
1 parent f3b7054 commit b72fe80

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python2port.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,16 @@ 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))
115113
else:
116114
lst.append("PING FAIL")
117115
if ipup == True:
118116
lst.append("PORT OPEN")
119117
else:
120118
lst.append("PORT CLOSED")
121119

120+
if ping == True:
121+
# Collect ping statistics only when the host is up
122+
lst.append(pingStatistics(ip))
122123
""" lst.append(ping)
123124
lst.append(ipup) """
124125
return lst

0 commit comments

Comments
 (0)