This commit is contained in:
CanbiZ
2025-05-20 09:27:11 +02:00
parent 0e626b5028
commit 5f5478b19f
3 changed files with 30 additions and 1 deletions

View File

@@ -439,3 +439,14 @@ msg_progress() {
printf "\n" >&2
fi
}
run_container_safe() {
local ct="$1"
shift
local cmd="$*"
lxc-attach -n "$ct" -- bash -euo pipefail -c "
trap 'echo Aborted in container; exit 130' SIGINT SIGTERM
$cmd
" || __handle_general_error "lxc-attach to CT $ct"
}