summaryrefslogtreecommitdiff
path: root/lib/oxidized/pfsense.rb
blob: 078c2a4ee2190d054ab38519e9279ce104c237d8 (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
26
27
28
29
30
31
32
33
34
35
36
37
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
  end

  cfg :telnet do
    username /^Username:/
    password /^Password:/
  end

  cfg :telnet, :ssh do
    pre_logout 'exit'
  end
 

end