custom: Removed console_type fact
This commit is contained in:
parent
717c32957f
commit
7d05eebdcd
1 changed files with 0 additions and 30 deletions
|
@ -1,30 +0,0 @@
|
|||
|
||||
Facter.add('console_type') do
|
||||
setcode do
|
||||
begin
|
||||
Facter.kernel
|
||||
rescue
|
||||
Facter.loadfacts()
|
||||
end
|
||||
console = 'vga'
|
||||
kernel = Facter.value('kernel')
|
||||
if kernel == 'Linux'
|
||||
File.open('/proc/cmdline', 'r') do |f|
|
||||
while line = f.gets
|
||||
if line =~ /console=ttyS[0-9]/
|
||||
console = 'serial'
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif kernel == 'OpenBSD' and File.exists?('/etc/boot.conf')
|
||||
File.open('/etc/boot.conf', 'r') do |f|
|
||||
while line = f.gets
|
||||
if line =~ /^set tty com[0-9]$/
|
||||
console = 'serial'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
console
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue