adding DHCPD=no option again to not overwrite existing dhcpd.conf
This commit is contained in:
parent
3de2ea491c
commit
eb0f18651f
@ -22,6 +22,7 @@ VMDUSERS="vmdusers"
|
|||||||
SWITCH="uplink_vlan931 uplink_vlan910"
|
SWITCH="uplink_vlan931 uplink_vlan910"
|
||||||
INTERFACE="veb931 veb910"
|
INTERFACE="veb931 veb910"
|
||||||
# dhcpd.conf
|
# dhcpd.conf
|
||||||
|
#DHCPD="no"
|
||||||
ROUTER="46.23.93.1"
|
ROUTER="46.23.93.1"
|
||||||
DNS="46.23.80.26"
|
DNS="46.23.80.26"
|
||||||
SUBNET="46.23.93.0"
|
SUBNET="46.23.93.0"
|
||||||
|
4
cease.sh
4
cease.sh
@ -43,7 +43,9 @@ if vmctl show ${1%.txt} >/dev/null 2>&1; then
|
|||||||
echo "a reset ${IPV4} ${IPV6}"
|
echo "a reset ${IPV4} ${IPV6}"
|
||||||
remove.pl ${1}
|
remove.pl ${1}
|
||||||
deploy.pl
|
deploy.pl
|
||||||
rcctl restart dhcpd
|
if [[ -z ${DHCPD} ]]; then
|
||||||
|
rcctl restart dhcpd
|
||||||
|
fi
|
||||||
vmctl reload
|
vmctl reload
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
# 2022/12/01 added: boot device net, move away from expect()
|
# 2022/12/01 added: boot device net, move away from expect()
|
||||||
# 2023/05/02 added: enable flag, allow for VMs to auto-start
|
# 2023/05/02 added: enable flag, allow for VMs to auto-start
|
||||||
# 2023/05/03 added: predefined IPv6 address, gw
|
# 2023/05/03 added: predefined IPv6 address, gw
|
||||||
|
# 2023/05/08 added: DHCPD=no to not overwrite existing dhcpd.conf, does require config for autoinstall(8)
|
||||||
#
|
#
|
||||||
use 5.024;
|
use 5.024;
|
||||||
use strict;
|
use strict;
|
||||||
@ -197,6 +198,7 @@ sub render_install_conf {
|
|||||||
my $jot_pass = qx(jot -rcs '' 20 46 125);
|
my $jot_pass = qx(jot -rcs '' 20 46 125);
|
||||||
chomp($jot_pass);
|
chomp($jot_pass);
|
||||||
my $_ipv4 = $vms{$vm_name}{'ipv4'} || "autoconf";
|
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 $_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 = $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";
|
my $_ipv6_gateway = $vms{$vm_name}{'ipv6_gw'} || $conf{'conf'}{'IPV6_PREFIX'} . ":" . ($conf{'conf'}{'IPV6_START'} + $vms{$vm_name}{'vm_number'}) . "::1";
|
||||||
@ -362,10 +364,12 @@ my %vms;
|
|||||||
my @files = glob "$conf{'conf'}{'VMS'}/*.txt";
|
my @files = glob "$conf{'conf'}{'VMS'}/*.txt";
|
||||||
%vms = get_variables('vms', @files);
|
%vms = get_variables('vms', @files);
|
||||||
|
|
||||||
|
$conf{'conf'}{'DHCPD'} = "yes" if (! $conf{'conf'}{'DHCPD'});
|
||||||
|
|
||||||
# run all functions
|
# run all functions
|
||||||
#debug_parse(\%conf, \%vms);
|
#debug_parse(\%conf, \%vms);
|
||||||
render_vm_conf(\%conf, \%vms);
|
render_vm_conf(\%conf, \%vms);
|
||||||
render_dhcpd_conf(\%conf, \%vms);
|
render_dhcpd_conf(\%conf, \%vms) if $conf{'conf'}{'DHCPD'} eq "yes";
|
||||||
render_install_conf(\%conf, \%vms);
|
render_install_conf(\%conf, \%vms);
|
||||||
create_accounts(\%conf, \%vms);
|
create_accounts(\%conf, \%vms);
|
||||||
create_img_files(\%conf, \%vms);
|
create_img_files(\%conf, \%vms);
|
||||||
|
@ -57,7 +57,9 @@ fi
|
|||||||
|
|
||||||
deploy.pl
|
deploy.pl
|
||||||
sleep 5
|
sleep 5
|
||||||
rcctl restart dhcpd
|
if [[ -z ${DHCPD} ]]; then
|
||||||
|
rcctl restart dhcpd
|
||||||
|
fi
|
||||||
vmctl reload
|
vmctl reload
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
@ -87,7 +89,9 @@ echo "completed"
|
|||||||
|
|
||||||
deploy.pl
|
deploy.pl
|
||||||
sleep 5
|
sleep 5
|
||||||
rcctl restart dhcpd
|
if [[ -z ${DHCPD} ]]; then
|
||||||
|
rcctl restart dhcpd
|
||||||
|
fi
|
||||||
vmctl reload
|
vmctl reload
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
@ -45,7 +45,9 @@ fi
|
|||||||
|
|
||||||
deploy.pl
|
deploy.pl
|
||||||
sleep 5
|
sleep 5
|
||||||
rcctl restart dhcpd
|
if [[ -z ${DHCPD} ]]; then
|
||||||
|
rcctl restart dhcpd
|
||||||
|
fi
|
||||||
vmctl reload
|
vmctl reload
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
@ -75,7 +77,9 @@ echo "completed"
|
|||||||
|
|
||||||
deploy.pl
|
deploy.pl
|
||||||
sleep 5
|
sleep 5
|
||||||
rcctl restart dhcpd
|
if [[ -z ${DHCPD} ]]; then
|
||||||
|
rcctl restart dhcpd
|
||||||
|
fi
|
||||||
vmctl reload
|
vmctl reload
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user