summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/model/netgear.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/oxidized/model/netgear.rb b/lib/oxidized/model/netgear.rb
index 951af1c..67675ad 100644
--- a/lib/oxidized/model/netgear.rb
+++ b/lib/oxidized/model/netgear.rb
@@ -14,15 +14,12 @@ class Netgear < Oxidized::Model
end
cfg :telnet, :ssh do
- if vars :enable
- post_login do
- send "enable\n"
- # Interpret enable: true as meaning we won't be prompted for a password
- unless vars(:enable).is_a? TrueClass
- expect /[pP]assword:\s?$/
- send vars(:enable) + "\n"
- end
- expect /^.+[#]$/
+ post_login do
+ if vars(:enable) == true
+ cmd "enable"
+ elsif vars(:enable)
+ cmd "enable", /[pP]assword:\s?$/
+ cmd vars(:enable)
end
end
post_login 'terminal length 0'