This commit is contained in:
teldra 2021-05-09 12:57:35 +02:00
parent 51b3787597
commit d0d7bd8cfe
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,12 @@ for i in $(find /dev/disk/by-id/ -type l -printf "%P\n"|grep -v "part" |tac); do
if [[ "${name}" == *"/dev/sr"* ]]; then
continue
fi
if [[ ! "${name}" == "ata-"* ]]; then
continue
fi
if [[ ! "${name}" == "usb-"* ]]; then
continue
fi
index=$(( index + 1 ))
size="$(fdisk -l "${name}" | head -n1 | awk '{print $3}')"
size=$(awk "BEGIN { printf(\"%.0f\n\", ${size}); }")