mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-21 18:40:20 +10:00
Exceptions
Improvement of exceptions on unsuccessful connection attempts
This commit is contained in:
@@ -1,13 +1,45 @@
|
||||
@echo off
|
||||
Setlocal EnableDelayedExpansion
|
||||
chcp 65001 >nul
|
||||
FOR /f %%i IN ('curl --write-out %%{http_code} --silent --output /dev/null --insecure https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1') do SET STATUS_CODE=%%i 2>nul
|
||||
IF %STATUS_CODE% == 200 (
|
||||
for /f %%i in ('curl --write-out %%{http_code} --silent --output /dev/null --insecure https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1') do set STATUS_CODE=%%i 2>nul
|
||||
if %STATUS_CODE% EQU 200 (
|
||||
chcp 866 >nul
|
||||
powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12}"; "& {(Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1').Content | Invoke-Expression}"
|
||||
)
|
||||
if %STATUS_CODE% LSS 1 (
|
||||
echo Нет подключения к сети
|
||||
echo Попытка повторного подключения через ...
|
||||
TIMEOUT /T 5
|
||||
cls
|
||||
for /f %%i in ('curl --write-out %%{http_code} --silent --output /dev/null --insecure https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1') do set STATUS_CODE=%%i 2>nul
|
||||
if "!STATUS_CODE!" EQU "200 " (
|
||||
cls
|
||||
chcp 866 >nul
|
||||
powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12}"; "& {(Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1').Content | Invoke-Expression}"
|
||||
) else (
|
||||
echo Снова ошибка
|
||||
echo Проверьте свое интернет соединение
|
||||
echo Скрипт остановлен
|
||||
pause
|
||||
exit
|
||||
)
|
||||
)
|
||||
if %STATUS_CODE% GTR 100 if not %STATUS_CODE% EQU 200 (
|
||||
echo Не удалось подключиться к github.com
|
||||
echo Код ответа HTTP %STATUS_CODE%
|
||||
echo Попытка повторного подключения через ...
|
||||
TIMEOUT /T 5
|
||||
cls
|
||||
for /f %%i in ('curl --write-out %%{http_code} --silent --output /dev/null --insecure https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1') do set STATUS_CODE=%%i 2>nul
|
||||
if "!STATUS_CODE!" EQU "200 " (
|
||||
cls
|
||||
chcp 866 >nul
|
||||
powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12}"; "& {(Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/amd64fox/SpotX/main/Install_rus.ps1').Content | Invoke-Expression}"
|
||||
) else (
|
||||
echo Нет доступа к github.com, проверьте свое интернет соединение.
|
||||
echo Код ответа HTTP %STATUS_CODE%
|
||||
echo Скрипт завершен.
|
||||
echo Снова ошибка
|
||||
echo Попробуйте запустить спустя некоторое время
|
||||
echo Скрипт остановлен
|
||||
)
|
||||
)
|
||||
pause
|
||||
exit
|
||||
Reference in New Issue
Block a user