summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-09-02 17:44:20 +0300
committerGitHub <noreply@github.com>2016-09-02 17:44:20 +0300
commit21e569117631dc39a94236d2c2e7e52bc3b13d12 (patch)
tree0ea32d1016cd425244db7864b0f9df93cb16200d
parent42d07c73d0483d35f3dbb93fe4944cc4b95d8192 (diff)
parent388db3a021317c0887b45f57b7045dbb81062a45 (diff)
Merge pull request #552 from boudreau/master
Update catos.rb
-rw-r--r--lib/oxidized/model/catos.rb11
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