Sha256: bec1e12a1c81838d93945b5c0b7c9f184921a9e6d50652328ad33e1d113727e7

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

class StoneOS < Oxidized::Model
  # Hillstone Networks StoneOS software

  prompt /^\r?[\w.()-]+~?[#>](\s)?$/
  comment '# '

  expect /^\s.*--More--.*$/ do |data, re|
    send ' '
    data.sub re, ''
  end

  cmd :all do |cfg|
    cfg.gsub! /+.*+/, '' # Linebreak handling
    cfg.cut_both
  end

  cmd 'show configuration running' do |cfg|
    cfg.gsub! /^Building configuration.*$/, ''
  end

  cmd 'show version' do |cfg|
    cfg.gsub! /^Uptime is .*$/, ''
    comment cfg
  end

  cfg :telnet do
    username(/^login:/)
    password(/^Password:/)
  end

  cfg :telnet, :ssh do
    post_login 'terminal length 256'
    post_login 'terminal width 512'
    pre_logout 'exit'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oxidized-0.29.0 lib/oxidized/model/stoneos.rb