Sha256: 5240d6e04552afe1e89ea4ac9e160d8879355ac0e1a5183ea5d6b12b31743ab5

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

class QuantaOS < Oxidized::Model
  using Refinements

  prompt /^\((\w|\S)+\) (>|#)$/
  comment '! '

  cmd 'show run' do |cfg|
    cfg.each_line.select do |line|
      (not line.match /^!.*$/) &&
        (not line.match /^\((\w|\S)+\) (>|#)$/) &&
        (not line.match /^show run$/)
    end.join
  end

  cfg :telnet do
    username /^User(name)?:/
    password /^Password:/
  end

  cfg :telnet, :ssh do
    post_login do
      send "enable\n"
      cmd vars(:enable) || ""
    end
    post_login 'terminal length 0'
    pre_logout do
      send "quit\n"
      send "n\n"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oxidized-0.31.0 lib/oxidized/model/quantaos.rb
oxidized-0.30.1 lib/oxidized/model/quantaos.rb
oxidized-0.30.0 lib/oxidized/model/quantaos.rb
oxidized-0.29.1 lib/oxidized/model/quantaos.rb