From 8693adbeb313d938efa72970a6800162fcebaf11 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 3 Dec 2025 17:32:11 +0100 Subject: [PATCH] Update unifi-os-server-vm.sh --- vm/unifi-os-server-vm.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/vm/unifi-os-server-vm.sh b/vm/unifi-os-server-vm.sh index f51377c06..e93476650 100644 --- a/vm/unifi-os-server-vm.sh +++ b/vm/unifi-os-server-vm.sh @@ -87,18 +87,11 @@ function get_valid_nextid() { local try_id try_id=$(pvesh get /cluster/nextid) while true; do - # Check if VM config exists if [ -f "/etc/pve/qemu-server/${try_id}.conf" ] || [ -f "/etc/pve/lxc/${try_id}.conf" ]; then try_id=$((try_id + 1)) continue fi - # Check if VM or CT actually exists (running or stopped) - if qm status "$try_id" &>/dev/null || pct status "$try_id" &>/dev/null; then - try_id=$((try_id + 1)) - continue - fi - # Check if LVM volumes with this ID exist - if lvs --noheadings -o lv_name 2>/dev/null | grep -qE "(^|[-_])${try_id}($|[-_])"; then + if lvs --noheadings -o lv_name | grep -qE "(^|[-_])${try_id}($|[-_])"; then try_id=$((try_id + 1)) continue fi