File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,11 +192,14 @@ main() {
192192 || [ -f " $release_dir /bin/capsper" ] \
193193 || die " Extracted release is missing capsper binaries"
194194
195- # Update top-level scripts from staged release
195+ # Update top-level scripts from staged release.
196+ # Use cp-to-temp + mv (rename) so the running script keeps its old inode —
197+ # a plain `cp` overwrites in-place, which corrupts bash's read position.
196198 for script in capsper-update.sh capsper-apply-update.sh capsper-rollback.sh; do
197199 if [ -f " $release_dir /$script " ]; then
198- cp " $release_dir /$script " " $INSTALL_DIR /"
199- chmod +x " $INSTALL_DIR /$script "
200+ cp " $release_dir /$script " " $INSTALL_DIR /$script .tmp"
201+ chmod +x " $INSTALL_DIR /$script .tmp"
202+ mv -f " $INSTALL_DIR /$script .tmp" " $INSTALL_DIR /$script "
200203 fi
201204 done
202205
You can’t perform that action at this time.
0 commit comments