summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--lib/oxidized/model/airos.rb20
2 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 704b158..348aa3a 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,7 @@
* Huawei VRP
* Juniper JunOS
* Juniper ScreenOS (Netscreen)
+ * Ubiquiti AirOS
# Install
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