Sha256: 8c0de05150f538baed0b2bc3c7b1bfc745f29c750c1e15722bc52b621acde1fe

Contents?: true

Size: 757 Bytes

Versions: 4

Compression:

Stored size: 757 Bytes

Contents

class ZyNOSCLI < Oxidized::Model
  using Refinements

  # Used in Zyxel DSLAMs, such as SAM1316

  # Typical prompt "XGS4600#"
  prompt /^([\w.@()-]+[#>]\s\e7)$/
  comment  ';; '

  cmd :all do |cfg|
    cfg.gsub! /^.*\e7/, ''
  end
  cmd 'show stacking'

  cmd 'show version'

  cmd 'show running-config'

  cfg :telnet do
    username /^User name:/i
    password /^Password:/i
  end

  cfg :telnet, :ssh do
    if vars :enable
      post_login do
        send "enable\n"
        # Interpret enable: true as meaning we won't be prompted for a password
        unless vars(:enable).is_a? TrueClass
          expect /[pP]assword:\s?$/
          send vars(:enable) + "\n"
        end
        expect /^.+[#]$/
      end
    end
    pre_logout 'exit'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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