pve-scripts/dist-upgrade.sh
2025-12-31 14:32:28 +01:00

57 lines
945 B
Bash

#!/bin/bash
#get a list and work on all of them in paralel
# Master updater
# get list of containers ranges
# fork script to run in conteiner (slave)
# run slave
# Slave updater
# rootfs /var/lib/lxc/$conteiner_id/rootfs/
printf "What conteiner next?\n"
read conteiner_id
fun_update($conteiner_id) {
pct enter $conteiner_id
apt update -y
apt dist-upgrade -y
#change bookworm to trixie in /etc/apt/
sed -i "s/bookworm/trixie/g" /etc/apt/sources.list
sed -i "s/bookworm/trixie/g" /etc/apt/sources.list.d/*
apt update -y
apt dist-upgrade -y
#it show a lot of info what to do with it TODO?
# a lot of defaluts
exit
}
if [[ conteiner_id =~ ^[0-9]+$ ]]; then
printf "Doing my part\n"
fun_update($conteiner_id)
else
printf "Sorry what?\n"
fi
printf "Do you want to continue? (Y/n):\n"
read next
if [[ $next =~ ("N"|"n") ]]; then
printf "Thx gl \n"
else
printf "ok, next round is coming\n"
./dist-upgrade.sh
fi