Update mermaids.sh
This commit is contained in:
parent
c3410553fb
commit
1a6eb32fe3
@ -82,10 +82,10 @@ fi
|
|||||||
# === 1. Create LXC Container ===
|
# === 1. Create LXC Container ===
|
||||||
log "Creating Debian 12 LXC container $LXC_ID ($LXC_HOSTNAME)..."
|
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 [[ -n "$LXC_IP" ]]; then
|
||||||
if [[ -z "$LXC_GATEWAY" ]]; 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"
|
NET_CONFIG="dhcp=1"
|
||||||
else
|
else
|
||||||
NET_CONFIG="ip=$LXC_IP/$LXC_NETMASK,gw=$LXC_GATEWAY"
|
NET_CONFIG="ip=$LXC_IP/$LXC_NETMASK,gw=$LXC_GATEWAY"
|
||||||
@ -94,7 +94,6 @@ else
|
|||||||
NET_CONFIG="dhcp=1"
|
NET_CONFIG="dhcp=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use NET_CONFIG in pct create
|
|
||||||
pct create $LXC_ID $LXC_TEMPLATE \
|
pct create $LXC_ID $LXC_TEMPLATE \
|
||||||
-hostname "$LXC_HOSTNAME" \
|
-hostname "$LXC_HOSTNAME" \
|
||||||
-memory "$LXC_MEMORY" \
|
-memory "$LXC_MEMORY" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user