From 8fb886a2a547973bf57f51478213a2e333b166be Mon Sep 17 00:00:00 2001 From: sunway910 Date: Wed, 31 Jul 2024 19:19:34 +0800 Subject: [PATCH] check installation --- install.sh | 8 +++++++- scripts/miner.sh | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index c3361b7..454aa03 100644 --- a/install.sh +++ b/install.sh @@ -48,6 +48,9 @@ install_dependencies() { if ! command_exists bc; then apt-get install -y bc fi + if ! command_exists dmidecode; then + apt install -y dmidecode + fi elif [ x"$DISTRO" == x"CentOS" ]; then log_info "------------Yum update--------------" @@ -68,6 +71,9 @@ install_dependencies() { if ! command_exists bc; then yum install -y bc fi + if ! command_exists dmidecode; then + yum install -y dmidecode + fi fi need_install_yq=1 @@ -201,7 +207,7 @@ install_mineradm() { if ! enableDockerAPI; then log_err "Fail to enable Docker API, try to enable it manually: https://docs.docker.com/config/daemon/remote-access/" log_info "The monitor service: watchdog, can not be run if docker api is not enabled." - cat /lib/systemd/system/backup-docker.service > /lib/systemd/system/docker.service + cat /lib/systemd/system/backup-docker.service >/lib/systemd/system/docker.service sudo systemctl daemon-reload sudo systemctl restart docker fi diff --git a/scripts/miner.sh b/scripts/miner.sh index c0851b7..f56cb1a 100644 --- a/scripts/miner.sh +++ b/scripts/miner.sh @@ -40,10 +40,11 @@ install() { fi docker compose -f $compose_yaml up -d $services - - if [ "$(yq eval ".services.watchdog-web" $compose_yaml)" ]; then - if [ "$(yq eval ".services.watchdog-web.environment" $compose_yaml)" ]; then - log_info "Storage monitor run at: http://localhost:13080" + if [ "$(yq eval ".watchdog.enable" $config_path)" == "true" ]; then + if [ "$(yq eval ".services.watchdog-web" $compose_yaml)" ]; then + if [ "$(yq eval ".services.watchdog-web.environment" $compose_yaml)" ]; then + log_info "Storage monitor run at: http://localhost:13080" + fi fi fi