|
1 | | -#!/usr/bin/env python |
2 | | - |
| 1 | +#!/usr/bin/env pythonend = timer() |
| 2 | +print(end - start) |
| 3 | +""" |
| 4 | +Program to check if a port is open. |
| 5 | +Takes an IP and a port as inputs and checks if the port is open at that IP. |
| 6 | +Usage : python portcheck.py <host> <port> |
| 7 | +""" |
3 | 8 | import errno, sys
|
4 | 9 | from socket import *
|
5 | 10 |
|
6 | 11 |
|
7 | 12 | if (len(sys.argv) > 1):
|
8 | | - |
| 13 | +end = timer() |
| 14 | +print(end - start) |
9 | 15 | # Assign the first argument (server) to 'remote_host'
|
10 | 16 | remote_host = sys.argv[1]
|
11 | 17 | # Assign the second argument (port) to 'server_port'
|
|
0 commit comments