From b1e49f82d5256c62121f1387aa7f22be0e9bc26a Mon Sep 17 00:00:00 2001 From: Will Glynn Date: Fri, 15 Aug 2014 11:03:45 -0500 Subject: Add Ubiquiti AirOS model --- lib/oxidized/model/airos.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/oxidized/model/airos.rb (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/airos.rb b/lib/oxidized/model/airos.rb new file mode 100644 index 0000000..316c4f0 --- /dev/null +++ b/lib/oxidized/model/airos.rb @@ -0,0 +1,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=" + cfg + end + + cfg :ssh do + exec true + end +end -- cgit v1.2.1