summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/pfsense.rb
blob: cd6885c54bbb29a0c1af5cbffea6d0aa7e38507a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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