From 3e913215f1ebd73711e0f219e04f45085b0ab1eb Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Wed, 15 Jan 2025 15:51:28 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E6=9B=B4=E6=96=B0=20git=20proxy=20[-]=20?= =?UTF-8?q?=E5=B7=B2=E5=AE=89=E8=A3=85docker=E7=9A=84=E4=B8=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init-docker.sh | 16 +++++++--------- init-git.sh | 4 +++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/init-docker.sh b/init-docker.sh index 2bb98a4..b8d63c0 100644 --- a/init-docker.sh +++ b/init-docker.sh @@ -18,9 +18,7 @@ elif command_exists docker; then echo "Docker 已安装.... 跳过安装" else curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/docker-install.sh | sh -fi - -cat > /etc/docker/daemon.json < /etc/docker/daemon.json < /etc/docker/daemon.json </dev/null 2>&1; then - systemctl restart docker -else - echo "systemctl 不存在,跳过 docker 重启。" -fi + if pidof systemd >/dev/null 2>&1; then + systemctl restart docker + else + echo "systemctl 不存在,跳过 docker 重启。" + fi +fi \ No newline at end of file diff --git a/init-git.sh b/init-git.sh index bb1aeb1..46c9703 100644 --- a/init-git.sh +++ b/init-git.sh @@ -3,7 +3,9 @@ # 检查 git 是否安装 if command -v git > /dev/null 2>&1; then echo "git 已安装,正在配置镜像源..." - git config --global url."https://git-proxy.hk.martin98.com/".insteadOf "https://" + # 曾经设置过的强制取消 + git config --global --unset url."https://git-proxy.hk.martin98.com/".insteadOf + git config --global url."https://git-proxy.hk.martin98.com/https://github.com/".insteadOf "https://github.com/" echo "镜像源配置完成。" else echo "git 不存在,跳过..."