diff options
author | ytti <saku@ytti.fi> | 2014-07-24 15:21:02 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2014-07-24 15:21:02 +0300 |
commit | d0a8379a72459ee57b31dee38b4e1ca0992d3772 (patch) | |
tree | bad302331157b8bc1fced8e9c8b5ae376e32acd0 | |
parent | ce190a6297b72cf33c40df5c726cc1ffea8c413d (diff) | |
parent | 66e9cdd926211793c8465daae8cedf27575580fa (diff) |
Merge pull request #30 from lysiszegerman/master
ScreenOS support
-rw-r--r-- | lib/oxidized/model/screenos.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/oxidized/model/screenos.rb b/lib/oxidized/model/screenos.rb new file mode 100644 index 0000000..922f401 --- /dev/null +++ b/lib/oxidized/model/screenos.rb @@ -0,0 +1,39 @@ +class ScreenOS < Oxidized::Model + + # Netscreen ScreenOS model # + + comment '! ' + + prompt '/^([\w.-\(\)]+->\s?)$/' + + cmd :all do |cfg| + cfg.each_line.to_a[2..-2].join + end + + cmd :secret do |cfg| + cfg.gsub! /^(set admin name) .*|^(set admin password) .*/, '\\1 <removed>' + cfg.gsub! /^(set admin user .* password) .* (.*)/, '\\1 <removed> \\2' + cfg.gsub! /(secret|password|preshare) .*/, '\\1 <secret hidden>' + cfg + end + + cmd 'get system' do |cfg| + comment cfg + end + + cmd 'get config' do |cfg| + cfg = cfg.each_line.to_a[3..-1].join + cfg + end + + cfg :telnet do + username '/^login:/' + password '/^password:/' + end + + cfg :telnet, :ssh do + post_login 'set console page 0' + pre_logout 'exit' + end + +end |