From 48d2179b0b3fc4249a871d2b43cbb2a1f2122e0a Mon Sep 17 00:00:00 2001 From: cd67-usrt Date: Mon, 3 Jul 2017 13:22:31 +0200 Subject: Update and rename sma.rb to ciscosma.rb --- lib/oxidized/model/ciscosma.rb | 45 ++++++++++++++++++++++++++++++++++++++++++ lib/oxidized/model/sma.rb | 45 ------------------------------------------ 2 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 lib/oxidized/model/ciscosma.rb delete mode 100644 lib/oxidized/model/sma.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/ciscosma.rb b/lib/oxidized/model/ciscosma.rb new file mode 100644 index 0000000..a52e38a --- /dev/null +++ b/lib/oxidized/model/ciscosma.rb @@ -0,0 +1,45 @@ +class CiscoSMA < Oxidized::Model + + # SMA prompt "mail.example.com> " + prompt /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/ + comment '! ' + + # Select passphrase display option + expect /using loadconfig command\. \[Y\]\>/ do |data, re| + send "y\n" + data.sub re, '' + end + + # handle paging + expect /-Press Any Key For More-+.*$/ do |data, re| + send " " + data.sub re, '' + end + + cmd 'version' do |cfg| + comment cfg + end + + cmd 'showconfig' do |cfg| + #Delete hour and date which change each run + #cfg.gsub! /\sCurrent Time: \S+\s\S+\s+\S+\s\S+\s\S+/, ' Current Time:' + # Delete select passphrase display option + cfg.gsub! /Do you want to mask the password\? Files with masked passwords cannot be loaded/, '' + cfg.gsub! /^\s+y/, '' + # Delete space + cfg.gsub! /\n\s{25}/, '' + # Delete after line + cfg.gsub! /([\/\-,.\w><@]+)(\s{27})/,"\\1" + # Add a carriage return + cfg.gsub! /([\/\-,.\w><@]+)(\s{6,8})([\/\-,.\w><@]+)/,"\\1\n\\2\\3" + # Delete prompt + cfg.gsub! /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/, '' + cfg + + end + + cfg :ssh do + pre_logout "exit" + end + +end diff --git a/lib/oxidized/model/sma.rb b/lib/oxidized/model/sma.rb deleted file mode 100644 index b551ee3..0000000 --- a/lib/oxidized/model/sma.rb +++ /dev/null @@ -1,45 +0,0 @@ -class SMA < Oxidized::Model - - # ESA prompt "mail.example.com> " - prompt /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/ - comment '! ' - - # Select passphrase display option - expect /using loadconfig command\. \[Y\]\>/ do |data, re| - send "y\n" - data.sub re, '' - end - - # handle paging - expect /-Press Any Key For More-+.*$/ do |data, re| - send " " - data.sub re, '' - end - - cmd 'version' do |cfg| - comment cfg - end - - cmd 'showconfig' do |cfg| - #Delete hour and date which change each run - #cfg.gsub! /\sCurrent Time: \S+\s\S+\s+\S+\s\S+\s\S+/, ' Current Time:' - # Delete select passphrase display option - cfg.gsub! /Do you want to mask the password\? Files with masked passwords cannot be loaded/, '' - cfg.gsub! /^\s+y/, '' - # Delete space - cfg.gsub! /\n\s{25}/, '' - # Delete after line - cfg.gsub! /([\/\-,.\w><@]+)(\s{27})/,"\\1" - # Add a carriage return - cfg.gsub! /([\/\-,.\w><@]+)(\s{6,8})([\/\-,.\w><@]+)/,"\\1\n\\2\\3" - # Delete prompt - cfg.gsub! /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/, '' - cfg - - end - - cfg :ssh do - pre_logout "exit" - end - -end -- cgit v1.2.1