Update update-lxcs.sh

This commit is contained in:
tteckster 2022-03-13 18:45:42 -04:00 committed by GitHub
parent 422854ff4e
commit f0d6cc57f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,14 +35,15 @@ function update_container() {
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 exec $container -- bash -c "apt update && apt upgrade -y && apt autoremove -y"
} }
clear
header_info
for container in $containers for container in $containers
do do
status=`pct status $container` status=`pct status $container`
if [ "$status" == "status: stopped" ]; then if [ "$status" == "status: stopped" ]; then
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n" echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
pct start $container pct start $container
echo -e "${BL}[Info]${GN} Waiting For${BL} $container To Start ${CL} \n" echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
sleep 5 sleep 5
update_container $container update_container $container
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n" echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"