Sha256: 69b0419205c23f330e9b5a555fcecb7934451b366b556087f7e76f2350d55ce8

Contents?: true

Size: 946 Bytes

Versions: 1

Compression:

Stored size: 946 Bytes

Contents

class Garderos < Oxidized::Model
  using Refinements
  # Garderos GmbH https://www.garderos.com/
  # Routers for harsh environments
  # grs = Garderos Router Software

  # remove all ANSI escape codes, as GRS uses them :-(
  # the prompt does not need to match escape codes, as they have been removed
  expect /\e\[\d*m\r?/ do |data, re|
    data.gsub re, ''
  end

  prompt /[\w-]+# /
  comment '# '

  cmd :all do |cfg|
    # Remove the echo of the entered command and the prompt after it
    cfg.cut_both
  end

  cmd 'show system version' do |cfg|
    comment "#{cfg}\n"
  end

  cmd 'show system serial' do |cfg|
    comment "#{cfg}\n"
  end

  # If we have a radio modem installed, we'd like to list the SIM Card
  cmd 'show hardware wwan wwan0 sim' do |cfg|
    if cfg.start_with? 'Unknown command'
      ''
    else
      comment "#{cfg}\n"
    end
  end

  cmd 'show configuration running'

  cfg :ssh do
    pre_logout 'exit'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oxidized-0.31.0 lib/oxidized/model/garderos.rb