Files
proxmox/scripts/archive/consolidated/deploy/install-bcryptjs.sh.bak

38 lines
1.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
set -euo pipefail
# Install bcryptjs in NPM container
set -e
PROXMOX_HOST="192.168.11.11"
CONTAINER_ID=105
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 Installing bcryptjs in NPM Container"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Container: $CONTAINER_ID on $PROXMOX_HOST"
echo ""
# Check if container is running
if ! ssh root@"$PROXMOX_HOST" "pct status $CONTAINER_ID" | grep -q "running"; then
echo "❌ Container $CONTAINER_ID is not running"
exit 1
fi
echo "📦 Installing bcryptjs (this may take a minute)..."
ssh root@"$PROXMOX_HOST" "pct exec $CONTAINER_ID -- bash -c 'cd /app && timeout 120 npm install bcryptjs --no-save'"
if [ $? -eq 0 ]; then
echo ""
echo "✅ bcryptjs installed successfully!"
echo ""
echo "Verifying installation..."
ssh root@"$PROXMOX_HOST" "pct exec $CONTAINER_ID -- bash -c 'cd /app && node -e \"const bcrypt = require(\\\"bcryptjs\\\"); console.log(\\\"✅ bcryptjs is working: \\\" + typeof bcrypt.hashSync);\"'"
else
echo ""
echo "❌ Failed to install bcryptjs"
exit 1
fi