2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-21 19:22:05 +00:00

Add code to check the os version by looking for the digit values

in the $os string.  If >= SLES 11 or >= RHEL 7, dhcpd and dhcpd6
share the same configuration file
This commit is contained in:
Victor Hu 2015-11-18 13:13:06 -05:00
parent ab5349cf29
commit da9d6a23ef

View File

@ -1601,10 +1601,15 @@ sub process_request
my $generatedpath = "$syspath/$dhcpver";
my $dhcpd_key = "DHCPDARGS";
if ($os =~ /sles/i || $os =~ /rhels7/i) {
# For SLES11+ and RHEL7+ Operating system releases, the
# dhcpd/dhcpd6 configuration is stored in the same file
my $os_ver = $os;
$os_ver =~ s/[^0-9.^0-9]//g;
if (($os =~ /sles/i && $os_ver >= 11) ||
($os =~ /rhels/i && $os_ver >= 7)) {
$dhcpd_key = "DHCPD_INTERFACE";
if ($usingipv6 and $dhcpver eq "dhcpd6") {
# For SLES 11 and RHEL7, the dhcpd6/dhcpd config are stored in the same file
$dhcpd_key = "DHCPD6_INTERFACE";
$generatedpath = "$syspath/dhcpd";
}