From e70a3a4b4d9c3c6a3772d06b1a24a5f0cf799b4c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:29:25 +0100 Subject: [PATCH] Fix Checkmk Version grep (#1341) --- ct/checkmk.sh | 2 +- install/checkmk-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/checkmk.sh b/ct/checkmk.sh index 7822d135..f1f930b8 100644 --- a/ct/checkmk.sh +++ b/ct/checkmk.sh @@ -29,7 +29,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | grep -v "*-rc" | tail -n +2 | head -n 1) + RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }') if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then msg_info "Updating ${APP} to v${RELEASE}" omd stop monitoring &>/dev/null diff --git a/install/checkmk-install.sh b/install/checkmk-install.sh index 892c057d..e94f90c5 100644 --- a/install/checkmk-install.sh +++ b/install/checkmk-install.sh @@ -22,7 +22,7 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" msg_info "Install Checkmk" -RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | grep -v "*-rc" | tail -n +2 | head -n 1) +RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }') wget -q https://download.checkmk.com/checkmk/${RELEASE}/check-mk-raw-${RELEASE}_0.bookworm_amd64.deb -O /opt/checkmk.deb $STD apt-get install -y /opt/checkmk.deb echo "${RELEASE}" >"/opt/checkmk_version.txt"