Skip to content

[小技巧] 检查当前ip是否国内机器

Problem Definition

Solution

#1

china=$(curl -s https://262235.xyz/ip/$(curl -s https://262235.xyz/ip/) | grep 中国)
if [[ ! -z "${china}" ]]; then
        echo $china
        # 中国使用阿里云镜像
        wget get.docker.com -O get.docker.sh
        bash  get.docker.sh  --mirror Aliyun
else
        # Docker 一键安装命令
        curl -fsSLo- get.docker.com | /bin/sh
fi

Leave a Reply

Your email address will not be published.