summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/oxidized/model/ios.rb8
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