From 994577920a89cb64822ae661f09c84730d8621df Mon Sep 17 00:00:00 2001 From: totosh Date: Mon, 18 Jul 2016 17:55:07 +0200 Subject: Rename gaiaos to gaiaos.rb --- lib/oxidized/model/gaiaos | 46 -------------------------------------------- lib/oxidized/model/gaiaos.rb | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 lib/oxidized/model/gaiaos create mode 100644 lib/oxidized/model/gaiaos.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/gaiaos b/lib/oxidized/model/gaiaos deleted file mode 100644 index 434e774..0000000 --- a/lib/oxidized/model/gaiaos +++ /dev/null @@ -1,46 +0,0 @@ -class GaiaOS < Oxidized::Model - - # CheckPoint - Gaia OS Model - - # Gaia Prompt - prompt /^([\[\]\w.@:-]+[#>]\s?)$/ - - # Comment tag - comment '# ' - - - cmd :all do |cfg| - cfg = cfg.each_line.to_a[1..-2].join - end - - cmd :secret do |cfg| - cfg.gsub! /^(set expert-password-hash ).*/, '\1' - cfg.gsub! /^(set user \S+ password-hash ).*/,'\1' - cfg.gsub! /^(set ospf .* secret ).*/,'\1' - cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1\3' - cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1\3' - cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed ' - cfg - end - - cmd 'show asset all' do |cfg| - comment cfg - end - - cmd 'show version all' do |cfg| - comment cfg - end - - cmd 'show configuration' do |cfg| - cfg.gsub! /^# Exported by \S+ on .*/, '# ' - cfg - end - - - cfg :ssh do - # User shell must be /etc/cli.sh - post_login 'set clienv rows 0' - pre_logout 'exit' - end - -end diff --git a/lib/oxidized/model/gaiaos.rb b/lib/oxidized/model/gaiaos.rb new file mode 100644 index 0000000..434e774 --- /dev/null +++ b/lib/oxidized/model/gaiaos.rb @@ -0,0 +1,46 @@ +class GaiaOS < Oxidized::Model + + # CheckPoint - Gaia OS Model + + # Gaia Prompt + prompt /^([\[\]\w.@:-]+[#>]\s?)$/ + + # Comment tag + comment '# ' + + + cmd :all do |cfg| + cfg = cfg.each_line.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg.gsub! /^(set expert-password-hash ).*/, '\1' + cfg.gsub! /^(set user \S+ password-hash ).*/,'\1' + cfg.gsub! /^(set ospf .* secret ).*/,'\1' + cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1\3' + cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1\3' + cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed ' + cfg + end + + cmd 'show asset all' do |cfg| + comment cfg + end + + cmd 'show version all' do |cfg| + comment cfg + end + + cmd 'show configuration' do |cfg| + cfg.gsub! /^# Exported by \S+ on .*/, '# ' + cfg + end + + + cfg :ssh do + # User shell must be /etc/cli.sh + post_login 'set clienv rows 0' + pre_logout 'exit' + end + +end -- cgit v1.2.1