Check if Synapse-Admin service exists (#4050)
Some checks are pending
Auto Update .app-files / update-app-files (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Close Discussion on PR Merge / close-discussion (push) Waiting to run
Frontend CI/CD / deploy (push) Blocked by required conditions
Frontend CI/CD / build (push) Waiting to run

This commit is contained in:
Slaviša Arežina
2025-04-25 08:42:11 +02:00
committed by GitHub
parent 2251f6bb5e
commit 2852c5b374

View File

@@ -47,23 +47,25 @@ function update_script() {
$STD apt-get -y upgrade $STD apt-get -y upgrade
msg_ok "Updated $APP LXC" msg_ok "Updated $APP LXC"
msg_info "Updating Synapse-Admin" if [[ -f /systemd/system/synapse-admin.service ]]; then
RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') msg_info "Updating Synapse-Admin"
if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
temp_file=$(mktemp) if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
systemctl stop synapse-admin temp_file=$(mktemp)
rm -rf /opt/synapse-admin systemctl stop synapse-admin
mkdir -p /opt/synapse-admin rm -rf /opt/synapse-admin
curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" mkdir -p /opt/synapse-admin
tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1 curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
cd /opt/synapse-admin tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1
$STD yarn install --ignore-engines cd /opt/synapse-admin
systemctl start synapse-admin $STD yarn install --ignore-engines
echo "${RELEASE}" >/opt/"${APP}"_version.txt systemctl start synapse-admin
rm -f "$temp_file" echo "${RELEASE}" >/opt/"${APP}"_version.txt
msg_ok "Update Successful" rm -f "$temp_file"
else msg_ok "Update Successful"
msg_ok "No update required. ${APP} is already at v${RELEASE}" else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
fi fi
exit exit
} }