From c9aa110f6c9ee959ae5401de98e89fb738c5248b Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 19 Aug 2021 12:15:07 +0800 Subject: [PATCH] install.sh - check docker is running --- extra/install.batsh | 7 +++++++ install.sh | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/extra/install.batsh b/extra/install.batsh index 259e00d5..8989d833 100644 --- a/extra/install.batsh +++ b/extra/install.batsh @@ -209,6 +209,13 @@ if (type == "local") { bash("exit 1"); } + bash("check=$(docker info)"); + + if (check == bash("*Is the docker daemon running*")) { + println("Error: docker is not running!"); + bash("exit 1"); + } + if ("$3" != "") { port = "$3"; } else { diff --git a/install.sh b/install.sh index acdcb1f5..699578a7 100644 --- a/install.sh +++ b/install.sh @@ -173,6 +173,11 @@ else if [ "$check" == "" ]; then "echo" "-e" "Error: docker is not found!" exit 1 +fi + check=$(docker info) + if [ "$check" == *Is the docker daemon running* ]; then + "echo" "-e" "Error: docker is not running!" + exit 1 fi if [ "$3" != "" ]; then port="$3"