Fixed releaseUpgrade scripts

Updated Debian upgrade commands to be beter suited for scirpts

Set command timeout to 0 for VM's

Fixed container reboots

Disabled Debian VM's upgrades - qemu-guest-agent quit while upgrading

Checking if ID is alive before asking its distro
This commit is contained in:
2023-11-19 20:10:04 +01:00
parent 2bc12f8ae2
commit 170757a749
3 changed files with 25 additions and 20 deletions

View File

@@ -34,16 +34,17 @@ if ! $IdExists; then echo "This ID does not exist"; exit; fi
#Check type of ID
if [[ $VMS =~ $ID ]];then
TYPE=VM;
DIST=$(qm guest exec $VMID -- awk -F= '$1=="ID" { print $2 ;}' /etc/os-release | jq '.["out-data"]')
if ! $(VM-State $ID); then echo "This ID is not runnig"; exit; fi
DIST=$(qm guest exec $ID -- awk -F= '$1=="ID" { print $2 ;}' /etc/os-release | jq '.["out-data"]')
fi
if [[ $CTS =~ $ID ]]; then
TYPE=CT
DIST=$(pct exec $CTID -- awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)
#Check if CT is running
if ! $(CT-State $ID); then echo "This ID is not runnig"; exit; fi
#Get CT distro
DIST=$(pct exec $ID -- awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)
fi
#Check if VM/CT is running
if ! $($TYPE-State $ID); then echo "This ID is not runnig"; exit; fi
#Check wich distro the CT/VM is running
if [[ "${DIST}" == *"debian"* ]]; then
#Ask the wanted Debian version