File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
modules/post/multi/gather Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ def run
70
70
71
71
72
72
print_status ( "Reading: #{ dbvis_file } " )
73
+ print_line ( )
73
74
raw_xml = ""
74
75
begin
75
76
raw_xml = read_file ( dbvis_file )
@@ -93,7 +94,7 @@ def run
93
94
print_line ( "\n " )
94
95
print_line ( db_table . to_s )
95
96
print_good ( "Try to query listed databases with dbviscmd.sh (or .bat) -connection <alias> -sql <statements> and have fun !" )
96
- print_good ( "" )
97
+ print_line ( )
97
98
# store found databases
98
99
p = store_loot (
99
100
"dbvis.databases" ,
@@ -131,9 +132,14 @@ def pareseNewConfigFile(raw_xml)
131
132
dbs = [ ]
132
133
db = { }
133
134
dbfound = false
134
-
135
+ versionFound = false
135
136
# fetch config file
136
137
raw_xml . each_line do |line |
138
+
139
+ if versionFound == false
140
+ vesrionFound = findVersion ( line )
141
+ end
142
+
137
143
if line =~ /<Database id=/
138
144
dbfound = true
139
145
elsif line =~ /<\/ Database>/
@@ -217,9 +223,15 @@ def pareseOldConfigFile(raw_xml)
217
223
dbs = [ ]
218
224
db = { }
219
225
dbfound = false
226
+ versionFound = false
220
227
221
228
# fetch config file
222
229
raw_xml . each_line do |line |
230
+
231
+ if versionFound == false
232
+ vesrionFound = findVersion ( line )
233
+ end
234
+
223
235
if line =~ /<Database id=/
224
236
dbfound = true
225
237
elsif line =~ /<\/ Database>/
@@ -266,4 +278,13 @@ def pareseOldConfigFile(raw_xml)
266
278
end
267
279
268
280
281
+ def findVersion ( tag )
282
+ found = false
283
+ if ( tag =~ /<Version>([\S +\s +]+)<\/ Version>/i )
284
+ print_good ( "DbVisualizer version : #{ $1} " )
285
+ found = true
286
+ end
287
+ return found
288
+ end
289
+
269
290
end
You can’t perform that action at this time.
0 commit comments