This commit is contained in:
2026-04-28 16:20:45 -05:00
parent 8219e09dc6
commit 6338a0400e
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
action="$1"
FOLDER='/opt/idssys/ta-proxmenu'
VERS='2026.4.28-1'
VERS='2026.4.28-3'
noupdate=' restart cpu mm '
+9 -3
View File
@@ -238,6 +238,7 @@ RESTART_PVE_SERVICES(){
}
SET_VM_SHUTDOWNTIMEOUT(){
# regex="down=([[:digit:]]+)"
if [ "${1}" == "" ]; then
echo -en "${idsCL[LightCyan]}Would you like to set all VM's shutdown timeout to 180secs (Y/n)?${idsCL[Default]} "
read -n 1 choice
@@ -247,9 +248,14 @@ SET_VM_SHUTDOWNTIMEOUT(){
case "${choice}" in
[Nn]) echo;;
*) echo
for vmid in $(pvesh get /cluster/resources --type vm --output-format json | jq '.[].vmid'); do
echo "Updating VM $vmid shutdown timeout to 180 seconds..."
qm set "$vmid" --startup "down=180"
#for vmid in $(pvesh get /cluster/resources --type vm --output-format json | jq '.[].vmid'); do
# NEW_TIMEOUTS=$(grep "startup:" /etc/pve/nodes/*/qemu-server/${VMID}.conf | awk '{print $2}')
# NEW_TIMEOUTS="(${NEW_TIMEOUTS})"
# [[ $NEW_TIMEOUTS =~ $regex ]] && down_value="${BASH_REMATCH[1]}"
echo "Updating all VM's shutdown timeout to 180 seconds..."
# sed -i "/startup:/c startup: ${NEW_TIMEOUTS}" /etc/pve/nodes/*/qemu-server/*.conf
sed -E -i 's/(down=)[0-9]+/\1180/g' /etc/pve/nodes/*/qemu-server/*.conf
done
;;
esac