From 5000d6b6b7173f73b25075396d2067303db671b4 Mon Sep 17 00:00:00 2001 From: cd67-usrt Date: Mon, 19 Jun 2017 13:25:17 +0200 Subject: Create esa.rb --- lib/oxidized/model/esa.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/oxidized/model/esa.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/esa.rb b/lib/oxidized/model/esa.rb new file mode 100644 index 0000000..a9f2126 --- /dev/null +++ b/lib/oxidized/model/esa.rb @@ -0,0 +1,49 @@ +class ESA < Oxidized::Model + + # ESA prompt "(mail.example.com)> " + prompt /^\r*([(][\w. ]+[)][#>]\s+)$/ + comment '! ' + + # Select passphrase display option + expect /\[\S+\]>\s/ do |data, re| + send "3\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! /Choose the passphrase option:/, '' + cfg.gsub! /1. Mask passphrases \(Files with masked passphrases cannot be loaded using/, '' + cfg.gsub! /loadconfig command\)/, '' + cfg.gsub! /2. Encrypt passphrases/, '' + cfg.gsub! /3. Plain passphrases/, '' + cfg.gsub! /^3$/, '' + #Delete space + cfg.gsub! /\n\s{25,26}/, '' + #Delete after line + cfg.gsub! /([-\\\/,.\w><@]+)(\s{25,27})/,"\\1" + # Add a carriage return + cfg.gsub! /([-\\\/,.\w><@]+)(\s{6})([-\\\/,.\w><@]+)/,"\\1\n\\2\\3" + # Delete prompt + cfg.gsub! /^\r*([(][\w. ]+[)][#>]\s+)$/, '' + cfg + + end + + cfg :ssh do + pre_logout "exit" + end + +end -- cgit v1.2.1 From 9d890a0572ad3b44a1f180379fb8506b2047dd88 Mon Sep 17 00:00:00 2001 From: cd67-usrt Date: Mon, 3 Jul 2017 08:48:15 +0200 Subject: Update and rename esa.rb to asyncos.rb --- lib/oxidized/model/asyncos.rb | 49 +++++++++++++++++++++++++++++++++++++++++++ lib/oxidized/model/esa.rb | 49 ------------------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 lib/oxidized/model/asyncos.rb delete mode 100644 lib/oxidized/model/esa.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/asyncos.rb b/lib/oxidized/model/asyncos.rb new file mode 100644 index 0000000..875690b --- /dev/null +++ b/lib/oxidized/model/asyncos.rb @@ -0,0 +1,49 @@ +class AsyncOS < Oxidized::Model + + # ESA prompt "(mail.example.com)> " + prompt /^\r*([(][\w. ]+[)][#>]\s+)$/ + comment '! ' + + # Select passphrase display option + expect /\[\S+\]>\s/ do |data, re| + send "3\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! /Choose the passphrase option:/, '' + cfg.gsub! /1. Mask passphrases \(Files with masked passphrases cannot be loaded using/, '' + cfg.gsub! /loadconfig command\)/, '' + cfg.gsub! /2. Encrypt passphrases/, '' + cfg.gsub! /3. Plain passphrases/, '' + cfg.gsub! /^3$/, '' + #Delete space + cfg.gsub! /\n\s{25,26}/, '' + #Delete after line + cfg.gsub! /([-\\\/,.\w><@]+)(\s{25,27})/,"\\1" + # Add a carriage return + cfg.gsub! /([-\\\/,.\w><@]+)(\s{6})([-\\\/,.\w><@]+)/,"\\1\n\\2\\3" + # Delete prompt + cfg.gsub! /^\r*([(][\w. ]+[)][#>]\s+)$/, '' + cfg + + end + + cfg :ssh do + pre_logout "exit" + end + +end diff --git a/lib/oxidized/model/esa.rb b/lib/oxidized/model/esa.rb deleted file mode 100644 index a9f2126..0000000 --- a/lib/oxidized/model/esa.rb +++ /dev/null @@ -1,49 +0,0 @@ -class ESA < Oxidized::Model - - # ESA prompt "(mail.example.com)> " - prompt /^\r*([(][\w. ]+[)][#>]\s+)$/ - comment '! ' - - # Select passphrase display option - expect /\[\S+\]>\s/ do |data, re| - send "3\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! /Choose the passphrase option:/, '' - cfg.gsub! /1. Mask passphrases \(Files with masked passphrases cannot be loaded using/, '' - cfg.gsub! /loadconfig command\)/, '' - cfg.gsub! /2. Encrypt passphrases/, '' - cfg.gsub! /3. Plain passphrases/, '' - cfg.gsub! /^3$/, '' - #Delete space - cfg.gsub! /\n\s{25,26}/, '' - #Delete after line - cfg.gsub! /([-\\\/,.\w><@]+)(\s{25,27})/,"\\1" - # Add a carriage return - cfg.gsub! /([-\\\/,.\w><@]+)(\s{6})([-\\\/,.\w><@]+)/,"\\1\n\\2\\3" - # Delete prompt - cfg.gsub! /^\r*([(][\w. ]+[)][#>]\s+)$/, '' - cfg - - end - - cfg :ssh do - pre_logout "exit" - end - -end -- cgit v1.2.1