Sha256: f4acef61f4b9e830ea071076a1666ed76c96606a8d594eb80876cd2fc6a03012

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

class CiscoSMA < Oxidized::Model
  # SMA prompt "mail.example.com> "
  prompt /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/
  comment '! '

  # Select passphrase display option
  expect /using loadconfig command\. \[Y\]>/ do |data, re|
    send "y\n"
    data.sub re, ''
  end

  # handle paging
  expect /-Press Any Key For More-+.*$/ do |data, re|
    send " "
    data.sub re, ''
  end

  cmd 'version' do |cfg|
    comment cfg
  end

  cmd 'showconfig' do |cfg|
    # Delete hour and date which change each run
    # cfg.gsub! /\sCurrent Time: \S+\s\S+\s+\S+\s\S+\s\S+/, ' Current Time:'
    # Delete select passphrase display option
    cfg.gsub! /Do you want to mask the password\? Files with masked passwords cannot be loaded/, ''
    cfg.gsub! /^\s+y/, ''
    # Delete space
    cfg.gsub! /\n\s{25}/, ''
    # Delete after line
    cfg.gsub! /([\/\-,.\w><@]+)(\s{27})/, "\\1"
    # Add a carriage return
    cfg.gsub! /([\/\-,.\w><@]+)(\s{6,8})([\/\-,.\w><@]+)/, "\\1\n\\2\\3"
    # Delete prompt
    cfg.gsub! /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/, ''
    cfg
  end

  cfg :ssh do
    pre_logout "exit"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
oxidized-0.29.0 lib/oxidized/model/ciscosma.rb
oxidized-0.28.0 lib/oxidized/model/ciscosma.rb
oxidized-0.27.0 lib/oxidized/model/ciscosma.rb
oxidized-0.26.3 lib/oxidized/model/ciscosma.rb
oxidized-0.26.2 lib/oxidized/model/ciscosma.rb
oxidized-0.26.1 lib/oxidized/model/ciscosma.rb
oxidized-0.26.0 lib/oxidized/model/ciscosma.rb
oxidized-0.25.1 lib/oxidized/model/ciscosma.rb
oxidized-0.25.0 lib/oxidized/model/ciscosma.rb