This commit is contained in:
spiritlhl 2023-08-04 03:22:36 +00:00
parent a98b4d5d81
commit 397487c729
6 changed files with 14 additions and 14 deletions

View file

@ -231,7 +231,7 @@ pct set $CTID --net0 name=eth0,ip=${user_ip}/24,bridge=vmbr1,gw=172.16.1.1
# else
# :
# fi
pct set $CTID --nameserver 8.8.8.8 --nameserver 8.8.4.4
pct set $CTID --nameserver 8.8.8.8,2001:4860:4860::8888 --nameserver 8.8.4.4,2001:4860:4860::8844
sleep 3
if echo "$system" | grep -qiE "centos|almalinux|rockylinux"; then
pct exec $CTID -- yum update -y

View file

@ -205,8 +205,8 @@ else
fi
pct start $CTID
pct set $CTID --hostname $CTID
pct set $CTID --net1 name=eth0,ip=${ipv6_address}/${ipv6_prefixlen},bridge=vmbr0,gw=${ipv6_gateway}
pct set $CTID --nameserver 8.8.8.8 --nameserver 8.8.4.4
pct set $CTID --net0 name=eth0,ip6=${ipv6_address}/${ipv6_prefixlen},bridge=vmbr0,gw6=${ipv6_gateway}
pct set $CTID --nameserver 8.8.8.8,2001:4860:4860::8888 --nameserver 8.8.4.4,2001:4860:4860::8844
sleep 3
if echo "$system" | grep -qiE "centos|almalinux|rockylinux" >/dev/null 2>&1; then
pct exec $CTID -- yum update -y

View file

@ -244,8 +244,8 @@ qm set $vm_num --boot order=scsi0
qm set $vm_num --memory $memory
# --swap 256
qm set $vm_num --ide2 ${storage}:cloudinit
qm set $vm_num --nameserver 8.8.8.8
qm set $vm_num --searchdomain 8.8.4.4
qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888
qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844
user_ip="172.16.1.${num}"
qm set $vm_num --ipconfig0 ip=${user_ip}/24,gw=172.16.1.1
# if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then

View file

@ -289,12 +289,12 @@ qm set $vm_num --boot order=scsi0
qm set $vm_num --memory $memory
# --swap 256
qm set $vm_num --ide2 ${storage}:cloudinit
qm set $vm_num --nameserver 8.8.8.8
qm set $vm_num --searchdomain 8.8.4.4
qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888
qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway}
else
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway} --ipconfig1 ip=${ipv6_address}/${ipv6_prefixlen},gw=${ipv6_gateway}
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway},ip6=${ipv6_address}/${ipv6_prefixlen},gw6=${ipv6_gateway}
fi
qm set $vm_num --cipassword $password --ciuser $user
sleep 5

View file

@ -294,12 +294,12 @@ qm set $vm_num --boot order=scsi0
qm set $vm_num --memory $memory
# --swap 256
qm set $vm_num --ide2 ${storage}:cloudinit
qm set $vm_num --nameserver 8.8.8.8
qm set $vm_num --searchdomain 8.8.4.4
qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888
qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway}
else
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway} --ipconfig1 ip=${ipv6_address}/${ipv6_prefixlen},gw=${ipv6_gateway}
qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway},ip6=${ipv6_address}/${ipv6_prefixlen},gw6=${ipv6_gateway}
fi
qm set $vm_num --cipassword $password --ciuser $user
sleep 5

View file

@ -224,9 +224,9 @@ qm set $vm_num --boot order=scsi0
qm set $vm_num --memory $memory
# --swap 256
qm set $vm_num --ide2 ${storage}:cloudinit
qm set $vm_num --nameserver 8.8.8.8
qm set $vm_num --searchdomain 8.8.4.4
qm set $vm_num --ipconfig1 ip=${ipv6_address}/${ipv6_prefixlen},gw=${ipv6_gateway}
qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888
qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844
qm set $vm_num --ipconfig0 ip6=${ipv6_address}/${ipv6_prefixlen},gw6=${ipv6_gateway}
qm set $vm_num --cipassword $password --ciuser $user
sleep 5
qm resize $vm_num scsi0 ${disk}G