#!/usr/bin/env bash # deploy.sh - Deploy Stirling-PDF Custom Theme & Files # Domain: stirling-pdf / free-warez.win # Target Host: free-warez.win -> /opt/containers/stirling-pdf/customFiles/ set -euo pipefail TARGET_HOST="free-warez.win" LOCAL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CUSTOM_DIR="$LOCAL_DIR/customFiles" REMOTE_DIR="/opt/containers/stirling-pdf/customFiles" echo "🚀 Deploying Stirling-PDF Custom Theme" echo " Target Host: $TARGET_HOST:$REMOTE_DIR" echo "=========================================================" # 1. Check SSH connection echo "📡 Checking SSH connection to $TARGET_HOST..." if ! ssh -q -o BatchMode=yes -o ConnectTimeout=5 "$TARGET_HOST" exit; then echo "❌ Cannot connect to $TARGET_HOST via SSH." exit 1 fi # 2. Sync files echo "🔄 Transferring custom files to $TARGET_HOST..." rsync -avz "$CUSTOM_DIR/" "$TARGET_HOST:$REMOTE_DIR/" # 3. Reload Stirling-PDF container echo "🔄 Reloading Stirling-PDF container..." ssh "$TARGET_HOST" "docker restart stirling-pdf" echo "✅ Stirling-PDF theme deployed successfully!" echo "✨ Deployment complete!"