diff options
author | Marco Li <macaty@users.noreply.github.com> | 2018-05-09 09:29:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-09 09:29:27 +0800 |
commit | be2a66feda3350673dd2d963a203e1cc5d68a017 (patch) | |
tree | 71a320330276e2debe64b35901e672579201df1b | |
parent | 4f7ccac68649d6505ba7bb287799c964ae848664 (diff) |
Create stoneos.rb
Add new model of Hillstone Networks StoneOS software
-rw-r--r-- | lib/oxidized/model/stoneos.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/oxidized/model/stoneos.rb b/lib/oxidized/model/stoneos.rb new file mode 100644 index 0000000..405e389 --- /dev/null +++ b/lib/oxidized/model/stoneos.rb @@ -0,0 +1,38 @@ +class Stoneos < Oxidized::Model +#Hillstone Networks StoneOS software + + prompt /^\r?[\w.()-]+[#>](\s)?$/ + comment '# ' + + expect /^\s.*--More--.*$/ do |data, re| + send ' ' + data.sub re, '' + end + + cmd :all do |cfg| + cfg = cfg.lines.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg + end + + cmd 'show configuration running' do |cfg| + cfg + end + + cmd 'show version' do |cfg| + comment cfg + end + + cfg :telnet do + username(/^login:/) + password(/^Password:/) + end + + cfg :telnet, :ssh do + post_login 'terminal length 256' + post_login 'terminal width 512' + pre_logout 'exit' + end +end |