From dade4b939ce4a3326edfa51665f6ec8a92d27716 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Mon, 22 Aug 2016 16:52:03 +0300 Subject: move pfsense to correct directory --- lib/oxidized/model/pfsense.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/oxidized/model/pfsense.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/pfsense.rb b/lib/oxidized/model/pfsense.rb new file mode 100644 index 0000000..cd6885c --- /dev/null +++ b/lib/oxidized/model/pfsense.rb @@ -0,0 +1,25 @@ +class PfSense < Oxidized::Model + + comment '# ' + + #add a comment in the final conf + def add_comment comment + "\n###### #{comment} ######\n" + end + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + #show the persistent configuration + pre do + cfg = add_comment 'Configuration' + cfg += cmd 'cat /cf/conf/config.xml' + end + + cfg :ssh do + exec true + pre_logout 'exit' + end + +end -- cgit v1.2.1