From 41b63495dbf14fae13a2bb27c1bb8d2164c33a5b Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 11 Aug 2024 08:49:29 -0400 Subject: [PATCH] Update matterbridge.sh refactor update --- ct/matterbridge.sh | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/ct/matterbridge.sh b/ct/matterbridge.sh index e0d04f26..097d025a 100644 --- a/ct/matterbridge.sh +++ b/ct/matterbridge.sh @@ -55,36 +55,7 @@ function default_settings() { function update_script() { header_info if [[ ! -d /opt/matterbridge ]]; then msg_error "No ${APP} Installation Found!"; exit; fi - -RELEASE=$(curl -s https://api.github.com/repos/Luligu/matterbridge/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') -if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Stopping ${APP} Service" - systemctl stop matterbridge - msg_ok "Stopped ${APP} Service" - - msg_info "Updating ${APP} to ${RELEASE}" - cd /opt/matterbridge - wget -q "https://github.com/Luligu/matterbridge/archive/refs/tags/${RELEASE}.zip" - unzip -q ${RELEASE}.zip - mv matterbridge-${RELEASE} /opt/matterbridge - cd /opt/matterbridge - npm ci >/dev/null 2>&1 - npm run build >/dev/null 2>&1 - echo "${RELEASE}" >/opt/${APP}_version.txt - msg_ok "Updated ${APP} to ${RELEASE}" - - msg_info "Cleaning up" - rm /opt/${RELEASE}.zip - msg_ok "Cleaned" - - msg_info "Starting ${APP} Service" - systemctl start matterbridge - sleep 1 - msg_ok "Started ${APP} Service" - msg_ok "Updated Successfully!\n" -else - msg_ok "No update required. ${APP} is already at ${RELEASE}" -fi +msg_error "Update via the Matterbridge UI" exit }