diff options
Diffstat (limited to 'lib/oxidized/model/ios.rb')
-rw-r--r-- | lib/oxidized/model/ios.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index c3027e2..7da5ed2 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -2,7 +2,22 @@ class IOS < Oxidized::Model 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 CFG.passwords[: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..-3].join end @@ -24,6 +39,11 @@ class IOS < Oxidized::Model cfg :telnet, :ssh do post_login 'terminal length 0' post_login 'terminal width 0' + # preferred way to handle additional passwords + #post_login do + # send "enable\n" + # send CFG.passwords[:enable] + "\n" + #end pre_logout 'exit' end |