summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2017-07-03 14:43:06 +0300
committerGitHub <noreply@github.com>2017-07-03 14:43:06 +0300
commit8e2e68392f2a13839ce43149a66488b8154c79e4 (patch)
treec29f0e3ed26fe4535008192dc64913107b46d6de /lib/oxidized
parentf96d9521a4b435b6c09d11e63e8e5602d7f033e6 (diff)
parent9d890a0572ad3b44a1f180379fb8506b2047dd88 (diff)
Merge pull request #896 from cd67-usrt/patch-1
Create esa.rb Email Security Appliance CISCO
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/model/asyncos.rb49
1 files changed, 49 insertions, 0 deletions
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