#!/bin/bash # Deploy SRF Play plugin to Jellyfin server set -e # Configuration JELLYFIN_SERVER="192.168.1.4" JELLYFIN_USER="dtourolle" # Change this to your SSH user DLL_PATH="Jellyfin.Plugin.SRFPlay/bin/Release/net8.0/Jellyfin.Plugin.SRFPlay.dll" # Colors GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${GREEN}=== Deploying SRF Play Plugin ===${NC}\n" # Check if DLL exists if [ ! -f "$DLL_PATH" ]; then echo "Error: DLL not found. Building..." dotnet build Jellyfin.Plugin.SRFPlay/Jellyfin.Plugin.SRFPlay.csproj -c Release fi echo "Step 1: Copying DLL to Jellyfin server..." scp "$DLL_PATH" "${JELLYFIN_USER}@${JELLYFIN_SERVER}:~/" echo -e "\nStep 2: Installing DLL on Jellyfin server..." ssh "${JELLYFIN_USER}@${JELLYFIN_SERVER}" << 'ENDSSH' echo "Stopping Jellyfin..." sudo systemctl stop jellyfin echo "Backing up old DLL..." sudo cp /var/lib/jellyfin/plugins/SRF/Jellyfin.Plugin.SRFPlay.dll \ /var/lib/jellyfin/plugins/SRF/Jellyfin.Plugin.SRFPlay.dll.backup || true echo "Installing new DLL..." sudo cp ~/Jellyfin.Plugin.SRFPlay.dll /var/lib/jellyfin/plugins/SRF/ sudo chown jellyfin:jellyfin /var/lib/jellyfin/plugins/SRF/Jellyfin.Plugin.SRFPlay.dll echo "Starting Jellyfin..." sudo systemctl start jellyfin echo "Waiting for Jellyfin to start..." sleep 5 echo "Checking Jellyfin status..." sudo systemctl status jellyfin --no-pager -l | head -20 ENDSSH echo -e "\n${GREEN}✓ Deployment complete!${NC}" echo -e "\n${YELLOW}Next steps:${NC}" echo "1. Test video playback - GUID errors should be fixed" echo "2. If videos still don't play due to geo-blocking, run network routing setup:" echo " scp setup-gateway-routing.sh cleanup-gateway-routing.sh ${JELLYFIN_USER}@${JELLYFIN_SERVER}:~" echo " ssh ${JELLYFIN_USER}@${JELLYFIN_SERVER}" echo " chmod +x setup-gateway-routing.sh" echo " sudo ./setup-gateway-routing.sh"