Merge pull request #283 from nicedevil007/nicedevil007-patch-1

Update for Alpine Linux LXCs
This commit is contained in:
tteckster 2022-06-14 15:50:16 -04:00 committed by GitHub
commit 920deee3d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -35,7 +35,14 @@ function update_container() {
clear clear
header_info header_info
echo -e "${BL}[Info]${GN} Updating${BL} $container ${CL} \n" 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 read -p "Skip stopped containers? " -n 1 -r
echo echo
@ -69,4 +76,5 @@ do
fi fi
done; wait done; wait
rm temp
echo -e "${GN} Finished, All Containers Updated. ${CL} \n" echo -e "${GN} Finished, All Containers Updated. ${CL} \n"