Update mermaids.sh

This commit is contained in:
Dan 2026-04-16 00:19:43 +08:00
parent 6a0be0cba8
commit c3410553fb

View File

@ -85,25 +85,24 @@ log "Creating Debian 12 LXC container $LXC_ID ($LXC_HOSTNAME)..."
# Build network config safely
if [[ -n "$LXC_IP" ]]; then
if [[ -z "$LXC_GATEWAY" ]]; then
warn "IP provided but no gateway — using DHCP for gateway resolution"
warn "Static IP provided but no gateway — using DHCP for gateway resolution"
NET_CONFIG="dhcp=1"
else
NET_CONFIG="ip=$LXC_IP/$LXC_NETMASK,gw=$LXC_GATEWAY"
fi
else
# No static IP → use DHCP
NET_CONFIG="dhcp=1"
fi
# 2. Use NET_CONFIG in pct create
# Use NET_CONFIG in pct create
pct create $LXC_ID $LXC_TEMPLATE \
-hostname $LXC_HOSTNAME \
-memory $LXC_MEMORY \
-cores $LXC_CORES \
-net0 name=eth0,bridge=$LXC_BRIDGE,$NET_CONFIG \
-rootfs $LXC_DISK:2 \
-hostname "$LXC_HOSTNAME" \
-memory "$LXC_MEMORY" \
-cores "$LXC_CORES" \
-net0 name=eth0,bridge="$LXC_BRIDGE",$NET_CONFIG \
-rootfs "$LXC_DISK:2" \
-ostype debian \
-password $LXC_ROOT_PASSWORD \
-password "$LXC_ROOT_PASSWORD" \
-onboot 1 \
-features nesting=1 \
-unprivileged 0