summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/airos.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-08-16 11:20:47 +0300
committerSaku Ytti <saku@ytti.fi>2014-08-16 11:20:47 +0300
commit9272a9b98786e65c206ca8206c1c327cf66ffb17 (patch)
tree73989456c1449a2f7697e9f4a36f153145a18bad /lib/oxidized/model/airos.rb
parent49db97088d370adb575a01f9d4446496dcff78cb (diff)
parentf0cbdd19179b2aa009c9f6ae29ecf4c01a3ad2a8 (diff)
Merge branch 'master' into cfg_as_object
Diffstat (limited to 'lib/oxidized/model/airos.rb')
-rw-r--r--lib/oxidized/model/airos.rb20
1 files changed, 20 insertions, 0 deletions
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=<hidden>"
+ cfg
+ end
+
+ cfg :ssh do
+ exec true
+ end
+end