summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/edgeswitch.rb12
-rw-r--r--lib/oxidized/model/mtrlrfs.rb2
-rw-r--r--lib/oxidized/model/netonix.rb15
3 files changed, 26 insertions, 3 deletions
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
diff --git a/lib/oxidized/model/mtrlrfs.rb b/lib/oxidized/model/mtrlrfs.rb
index 84bcfe1..8baa4e9 100644
--- a/lib/oxidized/model/mtrlrfs.rb
+++ b/lib/oxidized/model/mtrlrfs.rb
@@ -1,4 +1,4 @@
-class mtrlrfs < Oxidized::Model
+class Mtrlrfs < Oxidized::Model
# Motorola RFS/Extreme WM
diff --git a/lib/oxidized/model/netonix.rb b/lib/oxidized/model/netonix.rb
new file mode 100644
index 0000000..4624f83
--- /dev/null
+++ b/lib/oxidized/model/netonix.rb
@@ -0,0 +1,15 @@
+class Netonix < Oxidized::Model
+ prompt /^[\w\s.@_\/:-]+#/
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd 'cat config.json;echo'
+
+ cfg :ssh do
+ post_login 'cmdline'
+ pre_logout 'exit'
+ pre_logout 'exit'
+ end
+end