From 5170056078b3a1e11c8d872c720e3014530752c9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:27:59 +0100 Subject: [PATCH] Update actualbudget.sh --- ct/actualbudget.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ct/actualbudget.sh b/ct/actualbudget.sh index 63c94e3e..75dcdb19 100644 --- a/ct/actualbudget.sh +++ b/ct/actualbudget.sh @@ -32,18 +32,26 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + if ! command -v jq >/dev/null 2>&1; then + echo "Installing jq..." + apt-get install -y jq >/dev/null 2>&1 + echo "Installed jq..." + fi + msg_info "Updating ${APP}" - systemctl stop actualbudget.service + systemctl stop actualbudget RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq --raw-output '.[0].name') TEMPD="$(mktemp -d)" cd "${TEMPD}" wget -q https://codeload.github.com/actualbudget/actual-server/legacy.tar.gz/refs/tags/${RELEASE} -O - | tar -xz + mv /opt/actualbudget /opt/actualbudget_bak mv actualbudget-actual-server-*/* /opt/actualbudget/ cd /opt/actualbudget yarn install &>/dev/null - systemctl start actualbudget.service + systemctl start actualbudget msg_ok "Successfully Updated ${APP} to ${RELEASE}" rm -rf "${TEMPD}" + rm -rf /opt/actualbudget_bak exit }