Update bootstrap: 2026-01-18 07:52:01

This commit is contained in:
2026-01-18 07:52:01 +00:00
parent a92c8f271c
commit e8e92d21e6
3 changed files with 158 additions and 18 deletions

View File

@@ -33,6 +33,22 @@ TEMP_SCRIPT="/tmp/${TARGET}-$$.sh"
if "$NBCRYPT" decrypt "$ENC_FILE" "$TEMP_SCRIPT" 2>/dev/null; then
chmod +x "$TEMP_SCRIPT"
# Load SSH Agent environment if it was created by nbcrypt/BWS setup
# Only load if we don't already have a valid Agent Forward
AGENT_ENV_FILE="/tmp/.nb_agent_env_${USER:-$(id -un)}"
if [ -f "$AGENT_ENV_FILE" ]; then
# Check if we already have a valid SSH_AUTH_SOCK (Agent Forward)
if [ -z "${SSH_AUTH_SOCK:-}" ] || [ ! -S "${SSH_AUTH_SOCK}" ]; then
# No valid agent, safe to load from file
echo "🔑 Loading SSH Agent environment..."
source "$AGENT_ENV_FILE"
else
# Agent Forward exists, preserve it and skip file loading
echo "🔑 Using existing SSH Agent Forward (preserved)"
fi
fi
echo "✅ Executing ${TARGET} setup..."
exec bash "$TEMP_SCRIPT"
else
@@ -42,3 +58,6 @@ else
exit 1
fi