From 575c3ee1823a63b6039e6aedc9e4e1abe06dd4ef Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 19 Aug 2021 12:39:51 +0800 Subject: [PATCH] install.sh - check docker is running --- extra/install.batsh | 10 +++++----- install.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extra/install.batsh b/extra/install.batsh index 8989d833..31b8f425 100644 --- a/extra/install.batsh +++ b/extra/install.batsh @@ -3,7 +3,7 @@ // The command is working on Windows PowerShell and Docker for Windows only. -// curl -o uptime-kuma-install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash uptime-kuma-install.sh +// curl -o kuma_install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash kuma_install.sh println("====================="); println("Uptime Kuma Installer"); println("====================="); @@ -211,10 +211,10 @@ if (type == "local") { bash("check=$(docker info)"); - if (check == bash("*Is the docker daemon running*")) { - println("Error: docker is not running!"); - bash("exit 1"); - } + bash("if [[\"$check\" == *\"Is the docker daemon running\"*]]; then + echo \"Error: docker is not running\" + exit 1 + fi"); if ("$3" != "") { port = "$3"; diff --git a/install.sh b/install.sh index 699578a7..c3a48d9c 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ # install.sh is generated by ./extra/install.batsh, do not modify it directly. # "npm run compile-install-script" to compile install.sh # The command is working on Windows PowerShell and Docker for Windows only. -# curl -o uptime-kuma-install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash uptime-kuma-install.sh +# curl -o kuma_install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash kuma_install.sh "echo" "-e" "=====================" "echo" "-e" "Uptime Kuma Installer" "echo" "-e" "=====================" @@ -175,10 +175,10 @@ else 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 [["$check" == *"Is the docker daemon running"*]]; then + echo "Error: docker is not running" + exit 1 + fi if [ "$3" != "" ]; then port="$3" else