Update mermaids.sh

This commit is contained in:
Dan 2026-04-16 00:22:27 +08:00
parent c3410553fb
commit 1a6eb32fe3

View File

@ -82,10 +82,10 @@ fi
# === 1. Create LXC Container ===
log "Creating Debian 12 LXC container $LXC_ID ($LXC_HOSTNAME)..."
# Build network config safely
# Build NET_CONFIG safely BEFORE pct create
if [[ -n "$LXC_IP" ]]; then
if [[ -z "$LXC_GATEWAY" ]]; then
warn "Static IP provided but no gateway — using DHCP for gateway resolution"
warn "IP provided but no gateway — falling back to DHCP"
NET_CONFIG="dhcp=1"
else
NET_CONFIG="ip=$LXC_IP/$LXC_NETMASK,gw=$LXC_GATEWAY"
@ -94,7 +94,6 @@ else
NET_CONFIG="dhcp=1"
fi
# Use NET_CONFIG in pct create
pct create $LXC_ID $LXC_TEMPLATE \
-hostname "$LXC_HOSTNAME" \
-memory "$LXC_MEMORY" \