From 28a83e30f5a9e42024e08929d942e0b2a220d98f Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Sun, 5 Jan 2025 23:55:09 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E4=BF=AE=E6=94=B9=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init-apt.sh | 2 +- init-docker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/init-apt.sh b/init-apt.sh index ffc3262..01144a8 100644 --- a/init-apt.sh +++ b/init-apt.sh @@ -38,7 +38,7 @@ server ntp5.aliyun.com iburst driftfile /var/lib/chrony/drift allow 127.0.0.1 EOF -if command -v systemctl >/dev/null 2>&1; then +if pidof systemd >/dev/null 2>&1; then systemctl restart chrony && systemctl enable chrony else echo "systemctl 不存在,跳过 chrony 的重启" diff --git a/init-docker.sh b/init-docker.sh index 6dbe239..795a69d 100644 --- a/init-docker.sh +++ b/init-docker.sh @@ -21,7 +21,7 @@ cat > /etc/docker/daemon.json </dev/null 2>&1; then +if pidof systemd >/dev/null 2>&1; then systemctl restart docker else echo "systemctl 不存在,跳过 docker 重启。"