Compare commits

...

1 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
8d6675ffb7 fix(migration): atomic /usr/bin/update replacement to prevent syntax errors
All 8 migration scripts (runtipi, dockge, dokploy, coolify, komodo,
alpine-komodo, overseerr, jellyseerr) overwrote /usr/bin/update in-place
while the parent shell still had the file open for reading. Since the
new content is longer than the original, bash would read leftover bytes
after the child process exited, causing garbled output or syntax errors
like: /usr/bin/update: line 2: syntax error near unexpected token )

Fix:
- Write to a temp file first, then mv over /usr/bin/update (atomic
  inode replacement so parent shell sees EOF on old fd)
- Remove unnecessary shebang from heredoc content in overseerr/jellyseerr
  (consistent with all other update scripts and install.func)
2026-03-04 07:44:14 +01:00
8 changed files with 25 additions and 11 deletions

View File

@@ -48,9 +48,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_komodo 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_komodo 2>/dev/null || true

View File

@@ -46,9 +46,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/coolify.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/coolify.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_coolify 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_coolify 2>/dev/null || true

View File

@@ -48,9 +48,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/dockge.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/dockge.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_dockge 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_dockge 2>/dev/null || true

View File

@@ -46,9 +46,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/dokploy.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/dokploy.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_dokploy 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_dokploy 2>/dev/null || true

View File

@@ -45,14 +45,15 @@ function update_script() {
fi fi
msg_info "Switching update script to Seerr" msg_info "Switching update script to Seerr"
cat <<'EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
#!/usr/bin/env bash cat <<'EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/seerr.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/seerr.sh)"
EOF EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
msg_ok "Switched update script to Seerr" msg_ok "Switched update script to Seerr"
msg_warn "Please type 'update' again to complete the migration" msg_warn "Please type 'update' again to complete the migration"
exit exit 0
fi fi
msg_info "Updating Jellyseerr" msg_info "Updating Jellyseerr"

View File

@@ -52,9 +52,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_komodo 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_komodo 2>/dev/null || true

View File

@@ -44,10 +44,11 @@ function update_script() {
fi fi
msg_info "Switching update script to Seerr" msg_info "Switching update script to Seerr"
cat <<'EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
#!/usr/bin/env bash cat <<'EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/seerr.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/seerr.sh)"
EOF EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
msg_ok "Switched update script to Seerr" msg_ok "Switched update script to Seerr"
msg_warn "Please type 'update' again to complete the migration" msg_warn "Please type 'update' again to complete the migration"

View File

@@ -46,9 +46,11 @@ function update_script() {
fi fi
msg_info "Migrating update function" msg_info "Migrating update function"
cat <<'MIGRATION_EOF' >/usr/bin/update TMP_UPDATE=$(mktemp)
cat <<'MIGRATION_EOF' >"$TMP_UPDATE"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/runtipi.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/runtipi.sh)"
MIGRATION_EOF MIGRATION_EOF
mv "$TMP_UPDATE" /usr/bin/update
chmod +x /usr/bin/update chmod +x /usr/bin/update
ln -sf /usr/bin/update /usr/bin/update_runtipi 2>/dev/null || true ln -sf /usr/bin/update /usr/bin/update_runtipi 2>/dev/null || true