From 275e72ad7060c059916b61d738138981727afb4c Mon Sep 17 00:00:00 2001 From: Daniel Preussker Date: Mon, 13 Jun 2016 09:22:05 +0000 Subject: Added Quanta OS --- lib/oxidized/model/quanta.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/oxidized/model/quanta.rb (limited to 'lib/oxidized/model') 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 -- cgit v1.2.1