refactor(ct): migrate manual update backups to create_backup (batch 1)

Replace ad-hoc mv/cp .bak patterns with create_backup/restore_backup across
58 update scripts so failed updates can roll back via the shared ERR trap.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
MickLesk
2026-06-19 23:35:15 +02:00
parent 578089b69e
commit a1f4bc3240
58 changed files with 124 additions and 520 deletions
+2 -13
View File
@@ -38,22 +38,11 @@ function update_script() {
systemctl stop actions-runner
msg_ok "Stopped Service"
msg_info "Backing up runner configuration"
BACKUP_DIR="/opt/actions-runner.backup"
mkdir -p "$BACKUP_DIR"
for f in .runner .credentials .credentials_rsaparams .env .path; do
[[ -f /opt/actions-runner/$f ]] && cp -a /opt/actions-runner/$f "$BACKUP_DIR/"
done
msg_ok "Backed up configuration"
create_backup /opt/actions-runner/$f
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "actions-runner" "actions/runner" "prebuild" "latest" "/opt/actions-runner" "actions-runner-linux-x64-*.tar.gz"
restore_backup
msg_info "Restoring runner configuration"
for f in .runner .credentials .credentials_rsaparams .env .path; do
[[ -f "$BACKUP_DIR/$f" ]] && cp -a "$BACKUP_DIR/$f" /opt/actions-runner/
done
rm -rf "$BACKUP_DIR"
msg_ok "Restored configuration"
msg_info "Starting Service"
systemctl start actions-runner