diff options
author | boudreau <yves.boudreau@mcgill.ca> | 2016-09-02 10:32:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 10:32:51 -0400 |
commit | 388db3a021317c0887b45f57b7045dbb81062a45 (patch) | |
tree | 0ea32d1016cd425244db7864b0f9df93cb16200d /lib | |
parent | 42d07c73d0483d35f3dbb93fe4944cc4b95d8192 (diff) |
Update catos.rb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oxidized/model/catos.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/oxidized/model/catos.rb b/lib/oxidized/model/catos.rb index 874ebbc..bac9eec 100644 --- a/lib/oxidized/model/catos.rb +++ b/lib/oxidized/model/catos.rb @@ -1,6 +1,6 @@ class Catos < Oxidized::Model - prompt /^[\w.@-]+> \(enable\) $/ + prompt /^[\w.@-]+>\s?(\(enable\) )?$/ comment '# ' cmd :all do |cfg| @@ -28,8 +28,15 @@ class Catos < Oxidized::Model password /^Password:/ end - cfg :ssh, :telnet do + cfg :telnet, :ssh do post_login 'set length 0' + # preferred way to handle additional passwords + if vars :enable + post_login do + send "enable\n" + cmd vars(:enable) + end + end pre_logout 'exit' end |