From f68df8a372fffbbc3bcfdb15d758fbeeaad13213 Mon Sep 17 00:00:00 2001 From: nicedevil007 <17103076+nicedevil007@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:51:54 +0200 Subject: [PATCH] Update for Alpine Linux LXCs The script now take a look at the ostype of the LXC and afterwards will choose the right update commands to progress. --- misc/update-lxcs.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/misc/update-lxcs.sh b/misc/update-lxcs.sh index 369631f4..d179b866 100644 --- a/misc/update-lxcs.sh +++ b/misc/update-lxcs.sh @@ -35,7 +35,14 @@ function update_container() { clear header_info echo -e "${BL}[Info]${GN} Updating${BL} $container ${CL} \n" - pct exec $container -- bash -c "apt update && apt upgrade -y && apt autoremove -y" + pct config $container > temp + os=`awk '/^ostype/' temp | cut -d' ' -f2` + if [ "$os" == "alpine" ] + then + pct exec $container -- ash -c "apk update && apk upgrade" + else + pct exec $container -- bash -c "apt update && apt upgrade -y && apt autoremove -y" + fi } read -p "Skip stopped containers? " -n 1 -r echo @@ -69,4 +76,5 @@ do fi done; wait +rm temp echo -e "${GN} Finished, All Containers Updated. ${CL} \n"