From 80e18586ed6641c31972cd6ab4814d8dbb8a7864 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 31 Jan 2025 20:07:47 +0100 Subject: [PATCH] Update install_coral_lxc.sh --- scripts/install_coral_lxc.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/install_coral_lxc.sh b/scripts/install_coral_lxc.sh index addf157..8e7c087 100644 --- a/scripts/install_coral_lxc.sh +++ b/scripts/install_coral_lxc.sh @@ -75,12 +75,22 @@ select_container() { } -# Validate that the selected container is valid validate_container_id() { if [ -z "$CONTAINER_ID" ]; then msg_error "$(translate 'Container ID not defined. Make sure to select a container first.')" exit 1 fi + + # Check if the container is running and stop it before configuration + if pct status "$CONTAINER_ID" | grep -q "running"; then + msg_info "$(translate 'Stopping the container before applying configuration...')" + pct stop "$CONTAINER_ID" + msg_ok "$(translate 'Container stopped.')" + fi + if [ -z "$CONTAINER_ID" ]; then + msg_error "$(translate 'Container ID not defined. Make sure to select a container first.')" + exit 1 + fi }