Sha256: 5c142fae86294de319f06945b661db162f385d0ee6b748148eec31250f2816d1

Contents?: true

Size: 747 Bytes

Versions: 9

Compression:

Stored size: 747 Bytes

Contents

class ScreenOS  < Oxidized::Model

  # Netscreen ScreenOS model #

  comment  '! '

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

  cmd :all do |cfg|
    cfg.each_line.to_a[2..-2].join
  end

  cmd :secret do |cfg| 
    cfg.gsub! /^(set admin name) .*|^(set admin password) .*/, '\\1 <removed>'
    cfg.gsub! /^(set admin user .* password) .* (.*)/, '\\1 <removed> \\2'
    cfg.gsub! /(secret|password|preshare) .*/, '\\1 <secret hidden>'
    cfg
  end

  cmd 'get system' do |cfg|
    comment cfg
  end

  cmd 'get config' do |cfg|
    cfg = cfg.each_line.to_a[3..-1].join
    cfg
  end

  cfg :telnet do
    username '/^login:/'
    password '/^password:/'
  end

  cfg :telnet, :ssh do
    post_login 'set console page 0'
    pre_logout 'exit'
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
oxidized-0.5.0 lib/oxidized/model/screenos.rb
oxidized-0.4.1 lib/oxidized/model/screenos.rb
oxidized-0.4.0 lib/oxidized/model/screenos.rb
oxidized-0.3.0 lib/oxidized/model/screenos.rb
oxidized-0.2.4 lib/oxidized/model/screenos.rb
oxidized-0.2.3 lib/oxidized/model/screenos.rb
oxidized-0.2.2 lib/oxidized/model/screenos.rb
oxidized-0.2.1 lib/oxidized/model/screenos.rb
oxidized-0.2.0 lib/oxidized/model/screenos.rb