still allow predefined IPs with dhcpd

This commit is contained in:
mischa 2023-05-04 14:56:02 +02:00
parent 1deb682f87
commit d48936e76f
1 changed files with 3 additions and 2 deletions

View File

@ -198,6 +198,7 @@ sub render_install_conf {
my $jot_pass = qx(jot -rcs '' 20 46 125);
chomp($jot_pass);
my $_ipv4 = $vms{$vm_name}{'ipv4'} || "autoconf";
$_ipv4 = "autoconf" if $conf{'conf'}{'DHCPD'} eq "yes";
my $_ipv4_gateway = $vms{$vm_name}{'ipv4_gw'} || $conf{'conf'}{'ROUTER'};
my $_ipv6 = $vms{$vm_name}{'ipv6'} || $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::" . ($conf{'conf'}{'IP_START'} + $vms{$vm_name}{'vm_number'});
my $_ipv6_gateway = $vms{$vm_name}{'ipv6_gw'} || $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::1";
@ -362,12 +363,12 @@ my %vms;
my @files = glob "$conf{'conf'}{'VMS'}/*.txt";
%vms = get_variables('vms', @files);
my $DHCP = $conf{'conf'}{'DHCP'} || "yes";
$conf{'conf'}{'DHCPD'} = "yes" if ! $conf{'conf'}{'DHCPD'};
# run all functions
#debug_parse(\%conf, \%vms);
render_vm_conf(\%conf, \%vms);
render_dhcpd_conf(\%conf, \%vms) if $DHCP eq "yes";
render_dhcpd_conf(\%conf, \%vms) if $conf{'conf'}{'DHCPD'} eq "yes";
render_install_conf(\%conf, \%vms);
create_accounts(\%conf, \%vms);
create_img_files(\%conf, \%vms);