|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from module import Module
from runcmd import runProcess
import tomb
import os
def getInstance():
return INFOModule()
class INFOModule(Module):
def __init__(self):
self.name = "info"
self.description = "Extracts information about this machine"
self.requiredVars = []
self.vars = {}
def run(self):
path = tomb.getPath() + self.name + "/"
|
|
19
20
21
22
23
24
25
26
27
28
29
|
if(not os.path.exists(path)):
os.mkdir(path)
output,code = runProcess("lshw")
lshw = open(path + "lshw.txt", 'wb')
lshw.write(output)
lshw.close()
output,code = runProcess("dmidecode")
lshw = open(path + "dmidecode.txt", 'wb')
lshw.write(output)
lshw.close()
|