Update actualbudget.sh

This commit is contained in:
CanbiZ 2025-01-09 17:27:59 +01:00 committed by GitHub
parent 9a7dcef25a
commit 5170056078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}