Refactor MOTD/SSH setup in build script
Simplifies MOTD and SSH setup by sourcing common install functions and conditionally running motd_ssh. Improves error handling and messaging for debugging access during container initialization.
This commit is contained in:
parent
82439d30cd
commit
e2179db113
@ -2708,15 +2708,15 @@ EOF'
|
|||||||
# This ensures the container is fully booted and accessible via SSH
|
# This ensures the container is fully booted and accessible via SSH
|
||||||
if [[ "${DEV_MODE_MOTD:-false}" == "true" ]]; then
|
if [[ "${DEV_MODE_MOTD:-false}" == "true" ]]; then
|
||||||
msg_dev "Setting up MOTD and SSH for debugging access"
|
msg_dev "Setting up MOTD and SSH for debugging access"
|
||||||
pct exec "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" <<'MOTD_SETUP'
|
# Load common install functions and run motd_ssh if available
|
||||||
# Only run motd_ssh function if it exists
|
if pct exec "$CTID" -- bash -c "
|
||||||
if declare -f motd_ssh >/dev/null 2>&1; then
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/install.func)
|
||||||
motd_ssh
|
declare -f motd_ssh >/dev/null 2>&1 && motd_ssh || true
|
||||||
else
|
" >/dev/null 2>&1; then
|
||||||
msg_warn "motd_ssh function not found in ${var_install}.sh"
|
|
||||||
fi
|
|
||||||
MOTD_SETUP
|
|
||||||
msg_dev "MOTD/SSH ready - container accessible via SSH (IP: $ip_in_lxc)"
|
msg_dev "MOTD/SSH ready - container accessible via SSH (IP: $ip_in_lxc)"
|
||||||
|
else
|
||||||
|
msg_warn "MOTD/SSH setup failed, but continuing with installation"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run application installer
|
# Run application installer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user