diff options
author | Wild Kat <wk@futureinquestion.net> | 2018-03-17 11:30:47 +0100 |
---|---|---|
committer | Wild Kat <wk@futureinquestion.net> | 2018-03-17 11:30:47 +0100 |
commit | f17736cabf0edda6788eff206aa12c9e35a22341 (patch) | |
tree | 113fa19d95571137018e5465e07f499cfa551bd1 /lib/oxidized/model/opnsense.rb | |
parent | 81fc3a4b423d8ce9fe69def57007312a96db6f67 (diff) | |
parent | 7ecd5abe1cc2f2bbc6b29687352564cb7f087a5a (diff) |
refactor supermicro support
Diffstat (limited to 'lib/oxidized/model/opnsense.rb')
-rw-r--r-- | lib/oxidized/model/opnsense.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/oxidized/model/opnsense.rb b/lib/oxidized/model/opnsense.rb new file mode 100644 index 0000000..b874fca --- /dev/null +++ b/lib/oxidized/model/opnsense.rb @@ -0,0 +1,21 @@ +class OpnSense < Oxidized::Model + + # minimum required permissions: "System: Shell account access" + # must enable SSH and password-based SSH access + + cmd :all do |cfg| + cfg.each_line.to_a[1..-1].join + end + + cmd 'cat /conf/config.xml' do |cfg| + cfg.gsub! /\s<revision>\s*<time>\d*<\/time>\s*.*\s*.*\s*<\/revision>/, '' + cfg.gsub! /\s<last_rule_upd_time>\d*<\/last_rule_upd_time>/, '' + cfg + end + + cfg :ssh do + exec true + pre_logout 'exit' + end + +end |