Sha256: 9523e0c8b053574b06c896dbb3106b13f66b7a55346e08176081d00b5cddbf3e

Contents?: true

Size: 826 Bytes

Versions: 1

Compression:

Stored size: 826 Bytes

Contents

require 'yaml'
require 'singleton'

module Codesake
  module SSH
    class Config
      include Singleton
      attr_reader :config

      def self.read_conf(filename)
        self.instance.read_conf(filename)
      end

      def self.ports
        self.instance.config["config"]["ports_to_scan"]
      end

      def self.passwords
        self.instance.config["config"]["password_list"]
      end


      def read_conf(filename)
        @config = {"config"=>{"ports_to_scan"=>[22], "password_list"=>"root,password"}}
        @filename = nil
        @filename = filename if ! filename.nil? and File.exists?(filename)

        @config = YAML.load_file(conf_file) unless @filename.nil?

        @config["config"]["password_list"] = @config["config"]["password_list"].split(',')
        @config
      end



    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codesake_ssh-0.0.1 lib/codesake/ssh/config.rb