From f8be9c5a3597768128d70209daf4d40e527a7880 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 5 Mar 2014 13:54:36 +0200 Subject: Add AireOS support Crappy Cisco WLC 5k, much quality, very implementation, such secure * stop pre_logout from expecting prompt by default --- lib/oxidized/input/cli.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/input/cli.rb') diff --git a/lib/oxidized/input/cli.rb b/lib/oxidized/input/cli.rb index ab93b06..2e6ac35 100644 --- a/lib/oxidized/input/cli.rb +++ b/lib/oxidized/input/cli.rb @@ -5,6 +5,7 @@ module Oxidized def initialize @post_login = [] @pre_logout = [] + @username, @password, @exec = nil end def get @@ -15,7 +16,7 @@ module Oxidized end def disconnect_cli - @pre_logout.each { |command, block| block ? block.call : (cmd command) } + @pre_logout.each { |command, block| block ? block.call : (cmd command, nil) } end def post_login _post_login=nil, &block @@ -29,6 +30,15 @@ module Oxidized @pre_logout << [_pre_logout, block] end end + + def username re=/^(Username|login)/ + @username or @username = re + end + + def password re=/^Password/ + @password or @password = re + end + end end end -- cgit v1.2.1