mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-12 09:57:24 +02:00
Gotify: Migration to v3 (#15912)
This commit is contained in:
committed by
GitHub
parent
1dba4eb2ee
commit
f8cc69e244
@@ -36,6 +36,30 @@ function update_script() {
|
|||||||
fetch_and_deploy_gh_release "gotify" "gotify/server" "prebuild" "latest" "/opt/gotify" "gotify-linux-$(arch_resolve).zip"
|
fetch_and_deploy_gh_release "gotify" "gotify/server" "prebuild" "latest" "/opt/gotify" "gotify-linux-$(arch_resolve).zip"
|
||||||
chmod +x /opt/gotify/gotify-linux-$(arch_resolve)
|
chmod +x /opt/gotify/gotify-linux-$(arch_resolve)
|
||||||
|
|
||||||
|
if [[ ! -f /opt/gotify/gotify-server.env ]]; then
|
||||||
|
gotify_old_config=""
|
||||||
|
for f in /opt/gotify/config.yml /etc/gotify/config.yml; do
|
||||||
|
[[ -f "$f" ]] && gotify_old_config="$f" && break
|
||||||
|
done
|
||||||
|
if [[ -n "$gotify_old_config" ]]; then
|
||||||
|
msg_info "Migrating ${gotify_old_config} to env format (Gotify 3.x)"
|
||||||
|
if /opt/gotify/gotify-linux-$(arch_resolve) migrate-config "$gotify_old_config" >/opt/gotify/gotify-server.env 2>/dev/null; then
|
||||||
|
mv "$gotify_old_config" "${gotify_old_config}.bak"
|
||||||
|
msg_ok "Migrated config to /opt/gotify/gotify-server.env (backup: ${gotify_old_config}.bak)"
|
||||||
|
else
|
||||||
|
rm -f /opt/gotify/gotify-server.env
|
||||||
|
msg_warn "Config migration failed — left ${gotify_old_config} in place, review manually"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep -qE '^ExecStart=.* serve' /etc/systemd/system/gotify.service 2>/dev/null; then
|
||||||
|
msg_info "Migrating service to serve subcommand (Gotify 3.x)"
|
||||||
|
sed -i -E 's|^(ExecStart=/opt/gotify/.*gotify-linux-[^ ]+)$|\1 serve|' /etc/systemd/system/gotify.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
msg_ok "Migrated service to serve subcommand"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start gotify
|
systemctl start gotify
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ After=network.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/gotify
|
WorkingDirectory=/opt/gotify
|
||||||
ExecStart=/opt/gotify/./gotify-linux-$(arch_resolve)
|
ExecStart=/opt/gotify/gotify-linux-$(arch_resolve) serve
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user