From 3b5488f0d71f0f6857f9e13c37c7e8c120d625b7 Mon Sep 17 00:00:00 2001 From: shuki Date: Thu, 5 Mar 2026 03:33:31 +0200 Subject: [PATCH] Fix restore: correct removeacct argument order, add debug output cPanel's removeacct expects username before flags. Also capture and log the command output to aid debugging if termination still fails. Co-Authored-By: Claude Opus 4.6 --- lib/restore.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/restore.sh b/lib/restore.sh index da838b7..5add19e 100644 --- a/lib/restore.sh +++ b/lib/restore.sh @@ -131,11 +131,14 @@ restore_full_account() { # Terminate existing account if requested if [[ "$terminate" == "true" ]] && account_exists "$user"; then log_info "Terminating existing account $user before restore..." - if ! /scripts/removeacct --force "$user"; then + local removeacct_output + if ! removeacct_output=$(/scripts/removeacct "$user" --force 2>&1); then log_error "Failed to terminate account $user" + log_debug "removeacct output: $removeacct_output" rm -rf "$restore_dir" return 1 fi + log_debug "removeacct output: $removeacct_output" fi # Run restorepkg (--force to merge into existing account if present)