diff options
author | Daniel Preussker <f0o@users.noreply.github.com> | 2016-06-13 09:22:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 09:22:05 +0000 |
commit | 275e72ad7060c059916b61d738138981727afb4c (patch) | |
tree | 9e67848d3c01cac001d521a6577303ad91d7fe33 /lib | |
parent | 61eb0f24eb9d246a9b92742321770667878ecc59 (diff) |
Added Quanta OS
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oxidized/model/quanta.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/oxidized/model/quanta.rb b/lib/oxidized/model/quanta.rb new file mode 100644 index 0000000..870b772 --- /dev/null +++ b/lib/oxidized/model/quanta.rb @@ -0,0 +1,35 @@ +class Quanta < Oxidized::Model + + prompt /^\((\w|\S)+\) (>|#)$/ + comment '! ' + cmd 'show run' do |cfg| + cfg = cfg.each_line.select { |line| not line.match /^!.*$/ } + cfg = cfg.join + cfg = cfg.each_line.select { |line| not line.match /^\((\w|\S)+\) (>|#)$/ } + cfg = cfg.join + cfg = cfg.each_line.select { |line| not line.match /^show run$/ } + cfg = cfg.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 |