summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/airos.rb
blob: 775005f0caa87d683aaf00dbae4615a0f9b47ed2 (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 'sort /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