summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/airos.rb
blob: 316c4f04bfbe2f48e38724ce89223b0710745aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Airos < Oxidized::Model
  # Ubiquiti AirOS circa 5.x
  
  prompt /^[^#]+# /
  
  cmd 'cat /etc/board.info' do |cfg|
    cfg.split("\n").map { |line| "# #{line}" }.join("\n") + "\n"
  end
  
  cmd 'cat /tmp/system.cfg'
  
  cmd :secret do |cfg|
    cfg.gsub! /^(users\.\d+\.password|snmp\.community)=.+/, "# \\1=<hidden>"
    cfg
  end

  cfg :ssh do
    exec true
  end
end