-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkApp.py
More file actions
executable file
·32 lines (24 loc) · 838 Bytes
/
Copy pathNetworkApp.py
File metadata and controls
executable file
·32 lines (24 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Importing the necessary modules
import sys
from ip_file_valid import ip_file_valid
from ip_addr_valid import ip_addr_valid
from ip_reach import ip_reach
from ssh_connection import ssh_connection
from create_threads import create_threads
# Saving the list of IP addresses in ip.txt to a variable
ip_list = ip_file_valid()
# Verifying the validity of each IP address in the list
try:
ip_addr_valid(ip_list)
except KeyboardInterrupt:
print("\n\n* Program aborted by user. Exiting...\n")
sys.exit()
# Verifying the reachability of each IP address in the list
try:
ip_reach(ip_list)
except KeyboardInterrupt:
print("\n\n* Program aborted by user. Exiting...\n")
sys.exit()
# Calling threads creation function for one or multiple SSH connections
create_threads(ip_list, ssh_connection)
# End of program