diff options
author | Christoffer Stokbaek <christoffers@easyspeedy.com> | 2016-08-04 16:30:18 +0200 |
---|---|---|
committer | Christoffer Stokbaek <christoffers@easyspeedy.com> | 2016-08-04 16:30:18 +0200 |
commit | 1aca290d70b5f2dec16bc313111cca4155b80a23 (patch) | |
tree | cf45bf9b894ae099358cbb60bedfdaae945d95ed | |
parent | 3bcf2ebc61294f2421f69c501440e4040968949a (diff) |
Added support for pfSense
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lib/oxidized/pfsense.rb | 34 |
2 files changed, 35 insertions, 0 deletions
@@ -123,6 +123,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * Opengear * Palo Alto * PANOS + * pfSense * Quanta * Quanta / VxWorks 6.6 (1.1.0.8) * Supermicro diff --git a/lib/oxidized/pfsense.rb b/lib/oxidized/pfsense.rb new file mode 100644 index 0000000..67a1a49 --- /dev/null +++ b/lib/oxidized/pfsense.rb @@ -0,0 +1,34 @@ +class PfSense < Oxidized::Model + + prompt /^\e\[0;1;33m\[\S*\e\[0;1;33m\]\e\[0;1;33m\e\[\S*\e\[0;1;31m@\S*\e\[0;1;33m\]\S*\e\[0;1;31m:\e\[0;0;0m\s$/ + 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 :telnet do + username /^Username:/ + password /^Password:/ + end + + cfg :telnet, :ssh do + pre_logout 'exit' + end + + +end + |