Method: Msf::DataStore#from_file

Defined in:
lib/msf/core/data_store.rb

#from_file(path, name = 'global') ⇒ Object

Imports datastore values from the specified file path using the supplied name

[View source] [View on GitHub]

317
318
319
320
321
322
323
324
325
326
327
# File 'lib/msf/core/data_store.rb', line 317

def from_file(path, name = 'global')
  begin
    ini = Rex::Parser::Ini.from_file(path)
  rescue
    return
  end

  if ini.group?(name)
    merge!(ini[name])
  end
end