-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (37 loc) · 1.02 KB
/
main.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
''' IP Changer Module '''
import sys
import signal
from win32com.shell import shell
# Import scheduler functions
SCHEDULER = __import__('scheduler')
# Import utility functions
UTILITIES = __import__('util')
def signal_handler(signal, frame):
''' Handles the program exit '''
global SELECTED_NIC
UTILITIES.reset_nic(SELECTED_NIC)
print('Bye Bye!')
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
if shell.IsUserAnAdmin() != True:
print('\nI hate non-admin users! (-_- )\n')
sys.exit(0)
else:
# Welcome message
print('\nHello!\n')
print(' ;')
print(' /_\\')
print('\\(o.o)')
print(' `) (`\\')
print(' / \\\n\n')
# Collect system NICs
NIC_CONFIGS = UTILITIES.get_nic_list()
# Print system NICs
if len(NIC_CONFIGS) > 1:
UTILITIES.print_nic_list(NIC_CONFIGS)
# Get target NIC from user
SELECTED_NIC = UTILITIES.get_nic_input(NIC_CONFIGS)
else:
SELECTED_NIC = 0
# start the process
SCHEDULER.start(SELECTED_NIC)