summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/quantaos.rb
diff options
context:
space:
mode:
authorDaniel Preussker <f0o@users.noreply.github.com>2016-06-13 12:46:26 +0000
committerGitHub <noreply@github.com>2016-06-13 12:46:26 +0000
commit5c470d33d5c114c07a41650009753b388643d57e (patch)
treec43aeac89540a6a90c2cd5d886cadf2f9764a831 /lib/oxidized/model/quantaos.rb
parentb3b306afd277171fd4b6d232a68049eb60836ae3 (diff)
Update Quanta model name
Diffstat (limited to 'lib/oxidized/model/quantaos.rb')
-rw-r--r--lib/oxidized/model/quantaos.rb35
1 files changed, 35 insertions, 0 deletions
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