summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-06-13 15:47:49 +0300
committerGitHub <noreply@github.com>2016-06-13 15:47:49 +0300
commit3f150f372d7941b33c4ad8a1c1456aaf4751e346 (patch)
treec43aeac89540a6a90c2cd5d886cadf2f9764a831
parent61eb0f24eb9d246a9b92742321770667878ecc59 (diff)
parent5c470d33d5c114c07a41650009753b388643d57e (diff)
Merge pull request #469 from f0o/feature-quanta
Added Quanta OS
-rw-r--r--README.md2
-rw-r--r--lib/oxidized/model/quantaos.rb35
2 files changed, 37 insertions, 0 deletions
diff --git a/README.md b/README.md
index ed66b8a..584259d 100644
--- a/README.md
+++ b/README.md
@@ -115,6 +115,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* Opengear
* Palo Alto
* PANOS
+ * Quanta
+ * Quanta / VxWorks 6.6 (1.1.0.8)
* Supermicro
* Supermicro
* Ubiquiti
diff --git a/lib/oxidized/model/quantaos.rb b/lib/oxidized/model/quantaos.rb
new file mode 100644
index 0000000..274440d
--- /dev/null
+++ b/lib/oxidized/model/quantaos.rb
@@ -0,0 +1,35 @@
+class QuantaOS < Oxidized::Model
+
+ prompt /^\((\w|\S)+\) (>|#)$/
+ comment '! '
+
+ cmd 'show run' do |cfg|
+ cfg.each_line.select do |line|
+ not line.match /^!.*$/ and
+ not line.match /^\((\w|\S)+\) (>|#)$/ and
+ not line.match /^show run$/
+ end.join
+ end
+
+ cfg :telnet do
+ username /^Username:/
+ password /^Password:/
+ end
+
+ cfg :telnet, :ssh do
+ post_login do
+ send "enable\n"
+ if vars :enable
+ cmd vars(:enable)
+ else
+ cmd ""
+ end
+ end
+ post_login 'terminal length 0'
+ pre_logout do
+ send "quit\n"
+ send "n\n"
+ end
+ end
+
+end