diff options
author | Saku Ytti <saku@ytti.fi> | 2018-07-17 13:07:50 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2018-07-17 13:07:50 +0300 |
commit | 06705411e28cf747644beb78504c5d2a27713d1c (patch) | |
tree | 10651704d16a25802bb383ed371f90d41a56312d /lib/oxidized | |
parent | 3efcd35e4bcebbff79c4dcd9ac024a1957a5b8f2 (diff) |
Allow enabling without enable password
Fixes #1452
Diffstat (limited to 'lib/oxidized')
-rw-r--r-- | lib/oxidized/model/ios.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index 068ae05..73fe114 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -132,9 +132,11 @@ class IOS < Oxidized::Model cfg :telnet, :ssh do # preferred way to handle additional passwords - if vars :enable - post_login do - send "enable\n" + post_login do + if vars(:enable) == true + cmd "enable" + elsif vars(:enable) + cmd "enable", /^[pP]assword:/ cmd vars(:enable) end end |