mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-31 06:24:02 -04:00
Fix: Update gokapi binary name for v2.2.4+ and add migration step (#13377)
* Rename gokapi binary and update service Change the installed binary name from pre-v2.2.4 `gokapi-linux_amd64` to v2.2.4+ `gokapi` and update service configuration accordingly. Add a migration step to remove any legacy `gokapi-linux_amd64` binary file, update binary reference in existing `gokapi.service`, and reload systemd before starting the service. * Update comment for binary name migration --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,15 @@ function update_script() {
|
||||
|
||||
fetch_and_deploy_gh_release "gokapi" "Forceu/Gokapi" "prebuild" "latest" "/opt/gokapi" "*linux*amd64.zip"
|
||||
|
||||
# Migrate from pre-v2.2.4 binary name (gokapi-linux_amd64 -> gokapi)
|
||||
if [[ -f /opt/gokapi/gokapi-linux_amd64 ]]; then
|
||||
rm -f /opt/gokapi/gokapi-linux_amd64
|
||||
fi
|
||||
if grep -q "gokapi-linux_amd64" /etc/systemd/system/gokapi.service 2>/dev/null; then
|
||||
sed -i 's|gokapi-linux_amd64|gokapi|g' /etc/systemd/system/gokapi.service
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start gokapi
|
||||
msg_ok "Started Service"
|
||||
|
||||
@@ -17,7 +17,7 @@ fetch_and_deploy_gh_release "gokapi" "Forceu/Gokapi" "prebuild" "latest" "/opt/g
|
||||
|
||||
msg_info "Configuring Gokapi"
|
||||
mkdir -p /opt/gokapi/{data,config}
|
||||
chmod +x /opt/gokapi/gokapi-linux_amd64
|
||||
chmod +x /opt/gokapi/gokapi
|
||||
msg_ok "Configured Gokapi"
|
||||
|
||||
msg_info "Creating Service"
|
||||
@@ -29,7 +29,7 @@ Description=gokapi
|
||||
Type=simple
|
||||
Environment=GOKAPI_DATA_DIR=/opt/gokapi/data
|
||||
Environment=GOKAPI_CONFIG_DIR=/opt/gokapi/config
|
||||
ExecStart=/opt/gokapi/gokapi-linux_amd64
|
||||
ExecStart=/opt/gokapi/gokapi
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user