From 2e407d446f28dcf81ad5481e87064663896e3aa2 Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 23 Feb 2006 20:17:02 +0000 Subject: Identifying centos git-svn-id: http://reductivelabs.com/svn/facter/trunk@88 1f5c1d6a-bddf-0310-8f58-fc49e503516a --- lib/facter.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/facter.rb b/lib/facter.rb index 2551fc0..a31b137 100644 --- a/lib/facter.rb +++ b/lib/facter.rb @@ -502,7 +502,12 @@ FACTERVERSION = '1.1.2' elsif FileTest.exists?("/etc/fedora-release") "Fedora" elsif FileTest.exists?("/etc/redhat-release") - "RedHat" + txt = File.read("/etc/redhat-release") + if txt =~ /centos/i + "CentOS" + else + "RedHat" + end elsif FileTest.exists?("/etc/SuSE-release") "SuSE" end -- cgit