Fix incorrect command (?)

This commit is contained in:
SpikeHD 2022-04-23 21:27:39 -07:00
parent f9eb06c3e7
commit 5f4a4b2aae
2 changed files with 25 additions and 20 deletions

View File

@ -23,10 +23,10 @@ if "%PROXY_IP%" EQU "localhost" (
:loop
:: Check if the game is even running
@rem QPROCESS "%GAME_EXE_NAME%">NUL
@rem IF %ERRORLEVEL% NEQ 0 (
@rem exit /b
@rem )
:: tasklist /fi "ImageName eq %GAME_EXE_NAME%" /fo csv 2>NUL | find /I "%GAME_EXE_NAME%.exe">NUL
:: IF %ERRORLEVEL% NEQ 0 (
:: exit /b
:: )
:: Check if the proxy server process is running
:: https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script
@ -87,6 +87,6 @@ if "%PROXY_IP%" EQU "localhost" (
:: Reconnect to the WiFi
netsh wlan connect name="%WIFI%"
taskkill /f /fi "WINDOWTITLE eq Administrator: PS Killswitch"
:: taskkill /f /fi "WINDOWTITLE eq Administrator: PS Killswitch"
exit

View File

@ -1,4 +1,4 @@
@echo off
:: @echo off
:: Ensure admin
>nul 2>&1 reg query "HKU\S-1-5-19" || (
@ -32,7 +32,7 @@ start "Proxy Server" %ORIGIN%/ext/mitmdump.exe -s "%ORIGIN%/proxy/proxy.py" --ss
echo Opening %GAME_PATH%
:: Allow the proxy server to create the certificates
:: Allow the proxy server to open fully
ping 127.0.0.1 -n 5 > nul
for %%A in ("%GAME_PATH%") do (
@ -52,21 +52,26 @@ if "%ENABLE_KILLSWITCH%" EQU "true" (
:: On exit clean proxy stuff
:EXIT
if "%PROXY%" == "" (
echo Exiting...
if "%PROXY%" EQU "" (
echo Proxy not started, no need to clean up.
) else (
:: Clean proxy settings
echo Cleaning up proxy settings
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
:: Kill proxy server
taskkill /f /im mitmdump.exe
echo Done! See you next time!
timeout /t 2 /nobreak >nul
taskkill /f /fi "WINDOWTITLE eq Administrator: PS Launcher Script"
exit /b
)
:: Clean proxy settings
echo Cleaning up proxy settings...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
:: Kill proxy server
taskkill /f /im mitmdump.exe
echo Done! See you next time!
timeout /t 2 /nobreak >nul
:: taskkill /f /fi "WINDOWTITLE eq Administrator: PS Launcher Script"
exit /b