Sha256: 08ef228fc07256aceba384f6e11c809a5141ab3afa8a2b5eef7ce582901bbd64

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

class QuantaOS < Oxidized::Model
  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"
      if vars :enable
        cmd vars(:enable)
      else
        cmd ""
      end
    end
    post_login 'terminal length 0'
    pre_logout do
      send "quit\n"
      send "n\n"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
oxidized-0.28.0 lib/oxidized/model/quantaos.rb
oxidized-0.27.0 lib/oxidized/model/quantaos.rb
oxidized-0.26.3 lib/oxidized/model/quantaos.rb
oxidized-0.26.2 lib/oxidized/model/quantaos.rb
oxidized-0.26.1 lib/oxidized/model/quantaos.rb
oxidized-0.26.0 lib/oxidized/model/quantaos.rb