55 lines
1.4 KiB
Batchfile
55 lines
1.4 KiB
Batchfile
@echo off
|
|
REM === Interactive Server Configuration ===
|
|
echo ========================================
|
|
echo Lancache Cache Cleanup and Restart
|
|
echo ========================================
|
|
echo.
|
|
|
|
REM Prompt for username
|
|
set /p USER="Enter username"
|
|
|
|
REM Prompt for server IP
|
|
set /p HOST="Enter server IP"
|
|
|
|
REM Password hint (SSH will prompt for password)
|
|
echo.
|
|
echo Note: You will be prompted for the SSH password shortly.
|
|
echo.
|
|
pause
|
|
|
|
REM === Warning about cache deletion ===
|
|
echo.
|
|
echo WARNING: This will delete all cached game files!
|
|
echo.
|
|
set /p CONFIRM="Are you sure you want to continue? (Y/N): "
|
|
if /i not "%CONFIRM%"=="Y" (
|
|
echo.
|
|
echo Operation cancelled.
|
|
pause
|
|
exit /b 0
|
|
)
|
|
|
|
REM === Deleting Gamecache Files ===
|
|
echo.
|
|
echo Deleting game cache files and restarting containers...
|
|
ssh %USER%@%HOST% "rm -rf lancache/lancache/cache/cache* && cd lancache && docker-compose down && docker-compose up -d"
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo ERROR: Connection or execution failed!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM === Display status after restart ===
|
|
echo.
|
|
echo ========================================
|
|
echo Container Status
|
|
echo ========================================
|
|
ssh %USER%@%HOST% "cd lancache && docker-compose ps"
|
|
|
|
echo.
|
|
echo ========================================
|
|
echo Cache cleared and process completed!
|
|
echo ========================================
|
|
pause |