From 333a6ff28f144535d66c5d4801de194a5a79894a Mon Sep 17 00:00:00 2001 From: SuperManito <68613938+SuperManito@users.noreply.github.com> Date: Wed, 2 Nov 2022 06:31:59 +0800 Subject: [PATCH] bug fix --- DockerInstallation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DockerInstallation.sh b/DockerInstallation.sh index a3748fc..5f3ea49 100644 --- a/DockerInstallation.sh +++ b/DockerInstallation.sh @@ -486,13 +486,13 @@ function ShowVersion() { esac exit fi - if [[ $(systemctl is-active docker) == "active" ]]; then + if [[ $(systemctl is-active docker) != "active" ]]; then sleep 2 systemctl disable --now docker >/dev/null 2>&1 sleep 2 systemctl enable --now docker >/dev/null 2>&1 sleep 2 - if [[ $(systemctl is-active docker) == "active" ]]; then + if [[ $(systemctl is-active docker) != "active" ]]; then echo -e "\n$ERROR 检测到 Docker 服务启动异常,可能由于重复安装相同版本导致" echo -e "\n请执行 systemctl start docker 或 service docker start 命令尝试启动" echo -e "\n官方安装文档:https://docs.docker.com/engine/install"