From 510278960b34ad207058e975bfebdd57e4658d45 Mon Sep 17 00:00:00 2001 From: wolle604 <97309597+wolle604@users.noreply.github.com> Date: Thu, 18 Dec 2025 18:41:31 +0000 Subject: [PATCH] feat: excecute command in LXC: Script exited, when command isn't available in LXC. Added check if command exists in container, otherwise script will skip the container. (#10089) --- tools/pve/execute.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/pve/execute.sh b/tools/pve/execute.sh index fc19be981..3b34f97e5 100644 --- a/tools/pve/execute.sh +++ b/tools/pve/execute.sh @@ -50,7 +50,12 @@ function execute_in() { container=$1 name=$(pct exec "$container" hostname) echo -e "${BL}[Info]${GN} Execute inside${BL} ${name}${GN} with output: ${CL}" - pct exec "$container" -- bash -c "${custom_command}" | tee + if ! pct exec "$container" -- bash -c "command -v ${custom_command} >/dev/null 2>&1" + then + echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container has no command: ${custom_command}" + else + pct exec "$container" -- bash -c "${custom_command}" | tee + fi } for container in $(pct list | awk '{if(NR>1) print $1}'); do