From 8d676013b00283244487904451b481b5be1c8a64 Mon Sep 17 00:00:00 2001 From: "user.tax" Date: Sat, 24 Sep 2022 22:01:37 +0800 Subject: [PATCH] auto set GHPROXY for china user --- acme.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acme.sh b/acme.sh index 6420d06f..ccc9b19e 100755 --- a/acme.sh +++ b/acme.sh @@ -6,7 +6,11 @@ PROJECT_NAME="acme.sh" PROJECT_ENTRY="acme.sh" -PROJECT="https://github.com/acmesh-official/$PROJECT_NAME" +if ! curl -I --connect-timeout 1 -m 3 -s https://t.co > /dev/null ;then +GHPROXY=https://ghproxy.com/ +fi + +PROJECT="${GHPROXY}https://github.com/acmesh-official/$PROJECT_NAME" DEFAULT_INSTALL_HOME="$HOME/.$PROJECT_NAME"