From ef121cd327d54ac541c1ce2d029fe1d7d56104d1 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 26 Mar 2016 19:45:55 +0200 Subject: closes #370 --- lib/oxidized/model/edgeswitch.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/edgeswitch.rb b/lib/oxidized/model/edgeswitch.rb index cb921b8..7c82639 100644 --- a/lib/oxidized/model/edgeswitch.rb +++ b/lib/oxidized/model/edgeswitch.rb @@ -16,9 +16,17 @@ class EdgeSwitch < Oxidized::Model end cfg :telnet, :ssh do - post_login 'enable' - post_login 'terminal length 0' + post_login do + if vars :enable + send "enable\n" + cmd vars(:enable) + else + cmd 'enable' + end + cmd 'terminal length 0' + end pre_logout 'quit' + pre_logout 'n' end end -- cgit v1.2.1