version 1.15, 2009/06/28 14:22:04
|
version 1.18, 2011/05/05 15:48:25
|
Line 55 if (-e '/etc/redhat-release') {
|
Line 55 if (-e '/etc/redhat-release') {
|
$dist = 'rhes'.$1; |
$dist = 'rhes'.$1; |
} elsif ($versionstring =~ /CentOS release (\d+)/) { |
} elsif ($versionstring =~ /CentOS release (\d+)/) { |
$dist = 'centos'.$1; |
$dist = 'centos'.$1; |
} elsif ($versionstring =~ /Scientific Linux SL release ([\d\.]+) /) { |
} elsif ($versionstring =~ /Scientific Linux (SL )?release ([\d.]+) /) { |
$dist = 'scientific'.$1; |
my $ver = $1; |
|
$ver =~ s/\.\d+$//; |
|
$dist = 'scientific'.$ver; |
} else { |
} else { |
warn('Unable to interpret /etc/redhat-release '. |
warn('Unable to interpret /etc/redhat-release '. |
'to determine system type'); |
'to determine system type'); |
} |
} |
|
} elsif (-e '/etc/SuSE-release') { |
|
open(IN,'</etc/SuSE-release'); |
|
my $versionstring=<IN>; |
|
chomp($versionstring); |
|
close(IN); |
|
if ($versionstring =~ /^SUSE LINUX Enterprise Server ([\d\.]+) /i) { |
|
$dist='sles'.$1; |
|
} elsif ($versionstring =~ /^SuSE Linux ([\d\.]+) /i) { |
|
$dist = 'suse'.$1; |
|
} elsif ($versionstring =~ /^openSUSE ([\d\.]+) /i) { |
|
$dist = 'suse'.$1; |
|
} else { |
|
warn('Unable to interpret /etc/SuSE-release '. |
|
'to determine system type'); |
|
} |
} elsif (-e '/etc/issue') { |
} elsif (-e '/etc/issue') { |
open(IN,'</etc/issue'); |
open(IN,'</etc/issue'); |
my $versionstring=<IN>; |
my $versionstring=<IN>; |
Line 96 if (-e '/etc/redhat-release') {
|
Line 113 if (-e '/etc/redhat-release') {
|
warn('Unable to interpret /etc/debian_version '. |
warn('Unable to interpret /etc/debian_version '. |
'to determine system type'); |
'to determine system type'); |
} |
} |
} elsif (-e '/etc/SuSE-release') { |
|
open(IN,'</etc/SuSE-release'); |
|
my $versionstring=<IN>; |
|
chomp($versionstring); |
|
close(IN); |
|
if ($versionstring =~ /^SUSE LINUX Enterprise Server ([\d\.]+) /i) { |
|
$dist='sles'.$1; |
|
} elsif ($versionstring =~ /^SuSE Linux ([\d\.]+) /i) { |
|
$dist = 'suse'.$1; |
|
} elsif ($versionstring =~ /^openSUSE ([\d\.]+) /i) { |
|
$dist = 'suse'.$1; |
|
} else { |
|
warn('Unable to interpret /etc/SuSE-release '. |
|
'to determine system type'); |
|
} |
|
} else { |
} else { |
warn('Unknown installation: expecting a debian, suse, or redhat system'); |
warn('Unknown installation: expecting a debian, suse, or redhat system'); |
} |
} |