truncating longer strings
This commit is contained in:
parent
fdbd2d145a
commit
18b70e7c39
@ -560,7 +560,11 @@ if [ "$IMPORT_DISKS" == "yes" ]; then
|
|||||||
SCSI_NR=0
|
SCSI_NR=0
|
||||||
|
|
||||||
while read -r LSOUTPUT; do
|
while read -r LSOUTPUT; do
|
||||||
DISKARRAY+=("$LSOUTPUT" "" "OFF")
|
TRUNCATED="${LSOUTPUT:0:50}"
|
||||||
|
if [ ${#LSOUTPUT} -gt 50 ]; then
|
||||||
|
TRUNCATED="${TRUNCATED}..."
|
||||||
|
fi
|
||||||
|
DISKARRAY+=("$LSOUTPUT" "$TRUNCATED" "OFF")
|
||||||
done < <(ls /dev/disk/by-id | grep -E '^ata-|^nvme-|^usb-' | 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
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user