mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 05:10:40 +00:00
fix(overseerr,jellyseerr): fix Seerr migration corrupting /usr/bin/update (#12529)
The migration wrote the new update script directly to /usr/bin/update while the parent shell still had the file open for reading. Since the new content (with shebang) is longer than the original single-line file, bash would read leftover bytes from the new content after the child process exited, causing: /usr/bin/update: line 2: syntax error near unexpected token )' Fix: write to a temp file first, then mv over /usr/bin/update. This replaces the inode so the parent shell's fd sees EOF on the old (unlinked) inode instead of reading into the new content.
This commit is contained in:
+4
-2
@@ -45,14 +45,16 @@ 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)
|
||||||
|
cat <<'EOF' >"$TMP_UPDATE"
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
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"
|
||||||
|
|||||||
+3
-1
@@ -44,10 +44,12 @@ 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)
|
||||||
|
cat <<'EOF' >"$TMP_UPDATE"
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user