mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 将 github 代理放到文件头部
This commit is contained in:
parent
0516250f76
commit
426b54a2d0
@ -1,6 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
|
set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
||||||
|
set github_proxy=https://ghps.cc
|
||||||
|
|
||||||
:: Windows 7 SP1 winhttp 默认不支持 tls 1.2
|
:: Windows 7 SP1 winhttp 默认不支持 tls 1.2
|
||||||
:: https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392
|
:: https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392
|
||||||
@ -31,9 +32,11 @@ if !errorlevel! == 0 (
|
|||||||
:: mirrors.tuna.tsinghua.edu.cn 会强制跳转 https
|
:: mirrors.tuna.tsinghua.edu.cn 会强制跳转 https
|
||||||
set mirror=http://mirror.nju.edu.cn
|
set mirror=http://mirror.nju.edu.cn
|
||||||
|
|
||||||
echo !confhome! | findstr /c:"://raw.githubusercontent.com/" >nul
|
if defined github_proxy (
|
||||||
if !errorlevel! == 0 (
|
echo !confhome! | findstr /c:"://raw.githubusercontent.com/" >nul
|
||||||
set confhome=https://ghps.cc/!confhome!
|
if !errorlevel! == 0 (
|
||||||
|
set confhome=!github_proxy!/!confhome!
|
||||||
|
)
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
:: mirrors.kernel.org 在荷兰太慢
|
:: mirrors.kernel.org 在荷兰太慢
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
set -eE
|
set -eE
|
||||||
confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
||||||
|
github_proxy=https://ghps.cc
|
||||||
|
|
||||||
this_script=$(realpath "$0")
|
this_script=$(realpath "$0")
|
||||||
trap 'trap_err $LINENO $?' ERR
|
trap 'trap_err $LINENO $?' ERR
|
||||||
@ -1301,9 +1302,8 @@ esac
|
|||||||
# gitee 不支持ipv6
|
# gitee 不支持ipv6
|
||||||
# jsdelivr 有12小时缓存
|
# jsdelivr 有12小时缓存
|
||||||
# https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js#L31
|
# https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js#L31
|
||||||
if [[ "$confhome" == http*://raw.githubusercontent.com/* ]] &&
|
if [ -n "$github_proxy" ] && [[ "$confhome" = http*://raw.githubusercontent.com/* ]] && is_in_china; then
|
||||||
is_in_china; then
|
confhome=$github_proxy/$confhome
|
||||||
confhome=https://ghps.cc/$confhome
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 以下目标系统不需要进入alpine
|
# 以下目标系统不需要进入alpine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user