mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
Merge pull request #280 from spiritLHLS/master
效仿中文版shell给英文版shell增加中国IP判断 Co-authored-by: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com>
This commit is contained in:
commit
cda39cac27
@ -43,11 +43,40 @@ pre_check() {
|
|||||||
os_arch="riscv64"
|
os_arch="riscv64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GITHUB_RAW_URL="raw.githubusercontent.com/naiba/nezha/master"
|
## China_IP
|
||||||
GITHUB_URL="github.com"
|
if [[ -z "${CN}" ]]; then
|
||||||
Get_Docker_URL="get.docker.com"
|
if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then
|
||||||
Get_Docker_Argu=" "
|
echo "According to the information provided by ipapi.co, the current IP may be in China"
|
||||||
Docker_IMG="ghcr.io\/naiba\/nezha-dashboard"
|
read -e -r -p "Is the installation done with a Chinese Mirror? [Y/n] " input
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS] | [yY])
|
||||||
|
echo "Use Chinese Mirror"
|
||||||
|
CN=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
[nN][oO] | [nN])
|
||||||
|
echo "No Use Chinese Mirror"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "No Use Chinese Mirror"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${CN}" ]]; then
|
||||||
|
GITHUB_RAW_URL="raw.githubusercontent.com/naiba/nezha/master"
|
||||||
|
GITHUB_URL="github.com"
|
||||||
|
Get_Docker_URL="get.docker.com"
|
||||||
|
Get_Docker_Argu=" "
|
||||||
|
Docker_IMG="ghcr.io\/naiba\/nezha-dashboard"
|
||||||
|
else
|
||||||
|
GITHUB_RAW_URL="cdn.jsdelivr.net/gh/naiba/nezha@master"
|
||||||
|
GITHUB_URL="dn-dao-github-mirror.daocloud.io"
|
||||||
|
Get_Docker_URL="get.daocloud.io/docker"
|
||||||
|
Get_Docker_Argu=" -s docker --mirror Aliyun"
|
||||||
|
Docker_IMG="registry.cn-shanghai.aliyuncs.com\/naibahq\/nezha-dashboard"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
|
Loading…
Reference in New Issue
Block a user