version 1.22, 2019/05/27 01:26:31
|
version 1.25, 2021/12/20 03:13:29
|
Line 29
|
Line 29
|
|
|
my $dist='default'; |
my $dist='default'; |
my $unknown; |
my $unknown; |
if (-e '/etc/redhat-release') { |
if (-e '/etc/oracle-release') { |
|
open(IN,'</etc/oracle-release'); |
|
my $versionstring=<IN>; |
|
chomp($versionstring); |
|
close(IN); |
|
if ($versionstring =~ /^Oracle Linux Server release (\d+)/) { |
|
$dist = 'oracle'.$1; |
|
} |
|
} elsif (-e '/etc/redhat-release') { |
open(IN,'</etc/redhat-release'); |
open(IN,'</etc/redhat-release'); |
my $versionstring=<IN>; |
my $versionstring=<IN>; |
chomp($versionstring); |
chomp($versionstring); |
Line 56 if (-e '/etc/redhat-release') {
|
Line 64 if (-e '/etc/redhat-release') {
|
$dist = 'rhes'.$1; |
$dist = 'rhes'.$1; |
} elsif ($versionstring =~ /Red Hat Enterprise Linux release (\d+)/) { |
} elsif ($versionstring =~ /Red Hat Enterprise Linux release (\d+)/) { |
$dist = 'rhes'.$1; |
$dist = 'rhes'.$1; |
} elsif ($versionstring =~ /CentOS(?:| Linux) release (\d+)/) { |
} elsif ($versionstring =~ /CentOS(?:| Linux| Stream) release (\d+)/) { |
$dist = 'centos'.$1; |
$dist = 'centos'.$1; |
} elsif ($versionstring =~ /Scientific Linux (?:SL )?release ([\d.]+) /) { |
} elsif ($versionstring =~ /Scientific Linux (?:SL )?release ([\d.]+) /) { |
my $ver = $1; |
my $ver = $1; |
$ver =~ s/\.\d+$//; |
$ver =~ s/\.\d+$//; |
$dist = 'scientific'.$ver; |
$dist = 'scientific'.$ver; |
|
} elsif ($versionstring =~ /Rocky Linux release ([\d.]+)/) { |
|
my $ver = $1; |
|
$ver =~ s/\.\d+$//; |
|
$dist = 'rocky'.$ver; |
|
} elsif ($versionstring =~ /AlmaLinux release ([\d.]+)/) { |
|
my $ver = $1; |
|
$ver =~ s/\.\d+$//; |
|
$dist = 'alma'.$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'); |