From 7f65d48da9588fda54d20abc2535a05dae4d055b Mon Sep 17 00:00:00 2001 From: Matthias Cramer Date: Tue, 7 Mar 2017 10:03:43 +0100 Subject: added model for OneAccess OneOS Voice Gateways/Routers Slight modifications to gemspec for newer ssh gem and correct telnet syntax --- lib/oxidized/model/oneos.rb | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lib/oxidized/model/oneos.rb (limited to 'lib') diff --git a/lib/oxidized/model/oneos.rb b/lib/oxidized/model/oneos.rb new file mode 100644 index 0000000..eeaa2ce --- /dev/null +++ b/lib/oxidized/model/oneos.rb @@ -0,0 +1,58 @@ +class OneOS < Oxidized::Model + + prompt /^([\w.@()-]+#\s?)$/ + comment '! ' + + # example how to handle pager + #expect /^\s--More--\s+.*$/ do |data, re| + # send ' ' + # data.sub re, '' + #end + + # non-preferred way to handle additional PW prompt + #expect /^[\w.]+>$/ do |data| + # send "enable\n" + # send vars(:enable) + "\n" + # data + #end + + cmd :all do |cfg| + #cfg.gsub! /\cH+\s{8}/, '' # example how to handle pager + #cfg.gsub! /\cH+/, '' # example how to handle pager + cfg.each_line.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg.gsub! /^(snmp set-read-community ").*+?(".*)$/, '\\1