mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-11 01:44:38 +00:00
Refactor: Gotify (#6301)
* Refactor Gotify * Add tools.func fix * Update gotify.sh
This commit is contained in:
parent
1f1bc5f12d
commit
69e947246a
4 changed files with 34 additions and 29 deletions
13
ct/gotify.sh
13
ct/gotify.sh
|
@ -29,23 +29,18 @@ function update_script() {
|
|||
fi
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/gotify/server/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
if [[ "${RELEASE}" != "$(cat ~/.gotify 2>/dev/null)" ]] || [[ ! -f ~/.gotify ]]; then
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop gotify
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating ${APP} to ${RELEASE}"
|
||||
cd /opt/gotify
|
||||
curl -fsSL "https://github.com/gotify/server/releases/download/v${RELEASE}/gotify-linux-amd64.zip" -o $(basename "https://github.com/gotify/server/releases/download/v${RELEASE}/gotify-linux-amd64.zip")
|
||||
$STD unzip -o gotify-linux-amd64.zip
|
||||
rm -rf gotify-linux-amd64.zip
|
||||
chmod +x gotify-linux-amd64
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
fetch_and_deploy_gh_release "gotify" "gotify/server" "prebuild" "latest" "/opt/gotify" "gotify-linux-amd64.zip"
|
||||
chmod +x /opt/gotify/gotify-linux-amd64
|
||||
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start gotify
|
||||
msg_ok "Started ${APP}"
|
||||
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue