utils folder; check updates switcher

This commit is contained in:
Flowseal
2025-12-24 17:53:33 +03:00
parent 5a2b7d5e52
commit 56977c45a1
4 changed files with 918 additions and 880 deletions

View File

@@ -9,11 +9,14 @@ if "%~1"=="status_zapret" (
)
if "%~1"=="check_updates" (
if not "%~2"=="soft" (
start /b service check_updates soft
) else (
call :service_check_updates soft
if exist "%~dp0utils\check_updates.enabled" (
if not "%~2"=="soft" (
start /b service check_updates soft
) else (
call :service_check_updates soft
)
)
exit /b
)
@@ -38,6 +41,7 @@ setlocal EnableDelayedExpansion
cls
call :ipset_switch_status
call :game_switch_status
call :check_updates_switch_status
set "menu_choice=null"
echo ========= v!LOCAL_VERSION! =========
@@ -46,10 +50,11 @@ echo 2. Remove Services
echo 3. Check Status
echo 4. Run Diagnostics
echo 5. Check Updates
echo 6. Switch Game Filter (%GameFilterStatus%)
echo 7. Switch ipset (%IPsetStatus%)
echo 8. Update ipset list
echo 9. Run Tests
echo 6. Switch Check Updates (%CheckUpdatesStatus%)
echo 7. Switch Game Filter (%GameFilterStatus%)
echo 8. Switch ipset (%IPsetStatus%)
echo 9. Update ipset list
echo 10. Run Tests
echo 0. Exit
set /p menu_choice=Enter choice (0-9):
@@ -58,10 +63,11 @@ if "%menu_choice%"=="2" goto service_remove
if "%menu_choice%"=="3" goto service_status
if "%menu_choice%"=="4" goto service_diagnostics
if "%menu_choice%"=="5" goto service_check_updates
if "%menu_choice%"=="6" goto game_switch
if "%menu_choice%"=="7" goto ipset_switch
if "%menu_choice%"=="8" goto ipset_update
if "%menu_choice%"=="9" goto run_tests
if "%menu_choice%"=="6" goto check_updates_switch
if "%menu_choice%"=="7" goto game_switch
if "%menu_choice%"=="8" goto ipset_switch
if "%menu_choice%"=="9" goto ipset_update
if "%menu_choice%"=="10" goto run_tests
if "%menu_choice%"=="0" exit /b
goto menu
@@ -650,7 +656,7 @@ goto menu
:game_switch_status
chcp 437 > nul
set "gameFlagFile=%~dp0bin\game_filter.enabled"
set "gameFlagFile=%~dp0utils\game_filter.enabled"
if exist "%gameFlagFile%" (
set "GameFilterStatus=enabled"
@@ -680,6 +686,36 @@ pause
goto menu
:: CHECK UPDATES SWITCH =================
:check_updates_switch_status
chcp 437 > nul
set "checkUpdatesFlag=%~dp0utils\check_updates.enabled"
if exist "%checkUpdatesFlag%" (
set "CheckUpdatesStatus=enabled"
) else (
set "CheckUpdatesStatus=disabled"
)
exit /b
:check_updates_switch
chcp 437 > nul
cls
if not exist "%checkUpdatesFlag%" (
echo Enabling check updates...
echo ENABLED > "%checkUpdatesFlag%"
) else (
echo Disabling check updates...
del /f /q "%checkUpdatesFlag%"
)
pause
goto menu
:: IPSET SWITCH =======================
:ipset_switch_status
chcp 437 > nul
@@ -791,6 +827,7 @@ exit /b
:: RUN TESTS =============================
:run_tests
chcp 65001 >nul
cls
:: Check PowerShell
where powershell >nul 2>&1
@@ -814,6 +851,6 @@ if %errorLevel% neq 0 (
echo Starting configuration tests in PowerShell window...
echo.
start "" powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0bin\test zapret.ps1"
start "" powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0utils\test zapret.ps1"
pause
goto menu

View File

@@ -0,0 +1 @@
ENABLED

View File

@@ -1,35 +1,35 @@
# targets.txt - endpoint list for zapret.ps1 tests
#
# Format:
# KeyName = "https://host..." -> Runs HTTP/TLS checks + ping
# KeyName = "PING:1.2.3.4" -> Ping only
#
# Keys must be a single word (letters/digits/underscore), because the
# script parses them as simple identifiers. You can add or remove lines.
### Discord
DiscordMain = "https://discord.com"
DiscordGateway = "https://gateway.discord.gg"
DiscordCDN = "https://cdn.discordapp.com"
DiscordUpdates = "https://updates.discord.com"
### YouTube
YouTubeWeb = "https://www.youtube.com"
YouTubeShort = "https://youtu.be"
YouTubeImage = "https://i.ytimg.com"
YouTubeVideoRedirect = "https://redirector.googlevideo.com"
### Google
GoogleMain = "https://www.google.com"
GoogleGstatic = "https://www.gstatic.com"
### Cloudflare
CloudflareWeb = "https://www.cloudflare.com"
CloudflareCDN = "https://cdnjs.cloudflare.com"
### Public DNS (PING-only)
CloudflareDNS1111 = "PING:1.1.1.1"
CloudflareDNS1001 = "PING:1.0.0.1"
GoogleDNS8888 = "PING:8.8.8.8"
GoogleDNS8844 = "PING:8.8.4.4"
Quad9DNS9999 = "PING:9.9.9.9"
# targets.txt - endpoint list for zapret.ps1 tests
#
# Format:
# KeyName = "https://host..." -> Runs HTTP/TLS checks + ping
# KeyName = "PING:1.2.3.4" -> Ping only
#
# Keys must be a single word (letters/digits/underscore), because the
# script parses them as simple identifiers. You can add or remove lines.
### Discord
DiscordMain = "https://discord.com"
DiscordGateway = "https://gateway.discord.gg"
DiscordCDN = "https://cdn.discordapp.com"
DiscordUpdates = "https://updates.discord.com"
### YouTube
YouTubeWeb = "https://www.youtube.com"
YouTubeShort = "https://youtu.be"
YouTubeImage = "https://i.ytimg.com"
YouTubeVideoRedirect = "https://redirector.googlevideo.com"
### Google
GoogleMain = "https://www.google.com"
GoogleGstatic = "https://www.gstatic.com"
### Cloudflare
CloudflareWeb = "https://www.cloudflare.com"
CloudflareCDN = "https://cdnjs.cloudflare.com"
### Public DNS (PING-only)
CloudflareDNS1111 = "PING:1.1.1.1"
CloudflareDNS1001 = "PING:1.0.0.1"
GoogleDNS8888 = "PING:8.8.8.8"
GoogleDNS8844 = "PING:8.8.4.4"
Quad9DNS9999 = "PING:9.9.9.9"

File diff suppressed because it is too large Load Diff