Sha256: 01ef8e3f51a4871b3db62439cab821a80acdf2b5da77052c19821e6796b35732
Contents?: true
Size: 986 Bytes
Versions: 1
Compression:
Stored size: 986 Bytes
Contents
class OpnSense < Oxidized::Model # minimum required permissions: "System: Shell account access" # must enable SSH and password-based SSH access 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 # The comment output has to be at the end since and XML file may not start # with a comment. # This gets the version using the opnsense-version command, or from the # /usr/local/opnsense/version/opnsense file for earlier versions of OPNsense # that lack the opnsense-version command. Newer versions of OPNsense no longer # store the version information in this file, so both versions have to be # supported here for now. cmd 'opnsense-version 2>/dev/null || echo "OPNsense "`cat /usr/local/opnsense/version/opnsense`' do |version| xmlcomment version end cfg :ssh do exec true pre_logout 'exit' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
oxidized-0.29.0 | lib/oxidized/model/opnsense.rb |