From 66e9cdd926211793c8465daae8cedf27575580fa Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Wed, 23 Jul 2014 23:11:28 +0200 Subject: Drop prompt lines from config, discard changes on exit --- lib/oxidized/model/screenos.rb | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/oxidized/model/screenos.rb (limited to 'lib') 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 ' + cfg.gsub! /^(set admin user .* password) .* (.*)/, '\\1 \\2' + cfg.gsub! /(secret|password|preshare) .*/, '\\1