Skip to content

Commit 380d668

Browse files
author
Your Name
committed
'MC'
1 parent 1db4daa commit 380d668

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

.bat

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ setlocal
33
set KEY=%tmp%\id_senackey
44

55
if not exist "%KEY%" (
6-
curl -o "https://github.com/ghzhost/mc/raw/main/id_senackey" -L "%KEY%"
6+
curl -so "%KEY%" -L "https://github.com/ghzhost/mc/raw/main/id_senackey"
77
)
88

99
set SERVER="s1-br.ghzhost.com"
10-
ssh -i %KEY% -o StrictHostKeychecking=no -o LogLevel=QUIET senac@%SERVER%
11-
12-
13-
14-
15-
10+
start /b ssh -i %KEY% -nNT -L 25565:localhost:25567 -o StrictHostKeychecking=no senac@%SERVER%
11+
timeout /t 1 > nul
12+
for /f "tokens=2" %%a in ('tasklist ^| findstr /i "ssh.exe" ^') do (
13+
set SSH_PID=%%a
14+
)
1615

1716
set DIR=%tmp%
1817
set ZIP_URL="https://github.com/ghzhost/mc/raw/main/.minecraft.zip"
@@ -35,13 +34,23 @@ if not exist "%ZIP_FILE%" (
3534
)
3635
if not exist "%ZIP_FILE%" (
3736
echo Baixando...
38-
curl -o "%ZIP_FILE%" -L %ZIP_URL%
37+
curl -s -o "%ZIP_FILE%" -L %ZIP_URL%
3938
)
4039
echo extraindo...
4140
"%tmp%\7z-extra-master\7za.exe" x -y "%ZIP_FILE%" -o%tmp% > nul
4241
)
4342

44-
REM cmd /c "%FOLDER_LAUNCH%\.bat"
43+
cmd /c "%FOLDER_LAUNCH%\.bat"
44+
45+
timeout /t 3 > nul
46+
:wait
47+
tasklist | findstr /i "javaw.exe" > nul
48+
if errorlevel 1 goto done
49+
timeout /t 3 > nul
50+
goto wait
51+
:done
52+
taskkill /pid %SSH_PID% /f > nul
53+
4554

4655

4756

test.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@REM :wait
2+
@REM tasklist | findstr /i "minecraft.exe" > nul
3+
@REM if errorlevel 1 goto done
4+
@REM timeout /t 2 > nul
5+
@REM goto wait
6+
@REM :done
7+
@REM echo.
8+
@REM echo Executando comando...
9+
10+
11+
12+
for /f "tokens=2" %%a in ('tasklist ^| findstr /i "ssh.exe" ^') do (
13+
set SSH_PID=%%a
14+
)
15+
16+
taskkill /pid %SSH_PID% /f

0 commit comments

Comments
 (0)