forked from DataSploit/datasploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvault.py
More file actions
22 lines (21 loc) · 654 Bytes
/
vault.py
File metadata and controls
22 lines (21 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from termcolor import colored
from configobj import ConfigObj
def get_key(a):
config_path = os.path.dirname(__file__)
config_file = "%s/config.py" % config_path
if os.path.exists(config_file):
config = ConfigObj(config_file)
try:
if config[a] != '':
return config[a]
else:
msg = "[-] " + a + " not configured"
print colored(msg, 'yellow')
return None
except:
msg = "[!] " + a + " not present"
print colored(msg, 'yellow')
return None
else:
print colored("[-] Error opening config file", 'yellow')