-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathquick-setup
executable file
·52 lines (39 loc) · 1.72 KB
/
quick-setup
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
46
47
48
49
50
51
52
#!/usr/bin/env python
import os
HOSTAPD_BUILD_PATH = './hostapd-eaphammer/hostapd'
def read_deps_file(deps_file):
with open(deps_file) as fd:
return ' '.join([ line.strip() for line in fd ])
if __name__ == '__main__':
while True:
print '[*] Please select one of the following build targets:'
print '---> (1) RHEL/Centos/Fedora'
print '---> (2) Debian/Kali'
print
choice = raw_input('Enter 1 or 2: ')
if choice in ['1', '2']:
break
build_target = 'redhat' if choice == '1' else 'deb'
if build_target == 'redhat':
if raw_input('Do you want upgrade your installed packages ("dnf upgrade")(recommended)? [y/N]: ').lower() == 'y':
os.system('dnf upgrade')
print '\n[*] complete!\n'
else:
if raw_input('Do you want update your package list ("apt -y update")(recommended)? [y/N]: ').lower() == 'y':
os.system('apt -y update')
print '\n[*] complete!\n'
if raw_input('Do you want upgrade your installed packages ("apt -y upgrade")(recommended)? [y/N]: ').lower() == 'y':
os.system('apt -y upgrade')
print '\n[*] complete!\n'
print '\n[*] Installing build dependencies...\n'
if build_target == 'redhat':
os.system('dnf install %s' % read_deps_file('./build-deps/redhat.txt'))
else:
os.system('apt -y install %s' % read_deps_file('./build-deps/deb.txt'))
print '\n[*] complete!\n'
print '\n[*] Installing Python dependencies...\n'
os.system('pip install -r requirements.txt')
print '\n[*] complete!\n'
print '\n[*] Compiling hostapd...\n'
os.system("cd %s && make hostapd-eaphammer_lib" % HOSTAPD_BUILD_PATH)
print '\n[*] complete!\n'