summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/arbos.rb
blob: 389f3f6903f2dbbb64ca9c910c8d4aaa3f4afb94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class ARBOS  < Oxidized::Model

  # Arbor OS model #

  prompt /^[\S\s]+\n([\w.@-]+[:\/#>]+)\s?$/
  comment  '# '

  cmd 'system hardware' do |cfg|
    cfg.gsub! /^Boot\ time\:\s.+/, '' # Remove boot timer
    cfg.gsub! /^Load\ averages\:\s.+/, '' # Remove CPU load info
    cfg = cfg.each_line.to_a[2..-1].join
    comment cfg
  end

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

  cmd 'config show' do |cfg|
    cfg
  end

  cfg :ssh do
    exec true
    pre_logout 'exit'
  end
end