43 lines
1.0 KiB
Batchfile
43 lines
1.0 KiB
Batchfile
@echo off
|
|
REM === Interactive Server Configuration ===
|
|
echo ========================================
|
|
echo Lancache Container 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 === Restart Lancache Containers ===
|
|
echo.
|
|
echo Connecting to server %HOST% and restarting Lancache...
|
|
ssh %USER%@%HOST% "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 Process completed!
|
|
echo ========================================
|
|
pause |