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"