From 1780cd99c50d0a15d64769a77e81c6c6991b1af2 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 22 Feb 2023 15:42:48 -0500 Subject: [PATCH] Update update-lxcs.sh Start the container and perform an update if it is not a template. --- misc/update-lxcs.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/misc/update-lxcs.sh b/misc/update-lxcs.sh index 38031eb2..7aa00b17 100644 --- a/misc/update-lxcs.sh +++ b/misc/update-lxcs.sh @@ -49,16 +49,11 @@ function update_container() { esac } header_info -read -p "Skip stopped containers? [y/N]" -n 1 -r -echo -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - skip=no -else - skip=yes -fi + for container in $containers; do status=$(pct status $container) - if [ "$skip" == "no" ] && [ "$status" == "status: stopped" ]; then + template=$(pct config $container | grep -q "template:" && echo "true" || echo "false") + if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n" pct start $container echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"