Refactor pve_check function and update disk listing

See: https://github.com/community-scripts/ProxmoxVED/issues/1362#issuecomment-3897164396
This commit is contained in:
Joerg Heinemann 2026-02-13 14:41:11 +01:00 committed by GitHub
parent 7789a7f215
commit 684ae3e762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,7 @@ function check_root() {
fi
}
pve_check() {
function pve_check() {
local PVE_VER
PVE_VER="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')"
@ -533,7 +533,7 @@ if [ "$IMPORT_DISKS" == "yes" ]; then
while read -r LSOUTPUT; do
DISKARRAY+=("$LSOUTPUT" "" "OFF")
done < <(ls /dev/disk/by-id | grep -E '^ata-|^nvme-' | grep -v 'part')
done < <(ls /dev/disk/by-id | grep -E '^ata-|^nvme-|^usb-' | grep -v 'part')
SELECTIONS=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SELECT DISKS TO IMPORT" --checklist "\nSelect disk IDs to import. (Use Spacebar to select)\n" --cancel-button "Exit Script" 20 58 10 "${DISKARRAY[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit