fix: accurate ZFS used space calculation for #3175

This commit is contained in:
openoms 2022-06-20 16:45:39 +01:00
parent 6f040732b5
commit 9f0f7caec0
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65

View File

@ -423,8 +423,8 @@ if [ "$1" = "status" ]; then
hddUsedInfo="${datadrive} & ${storageDrive}"
elif [ "${isZFS}" -gt 0 ]; then
# ZFS calculations
hdd_used_space=$(zpool list -H | awk '{print $3}')
hdd_used_ratio=$((100 * ${hdd_used_space::-1} / hddGigaBytes))
hdd_used_space=$(($(zpool list -pH | awk '{print $3}')/1024/1024/1024))
hdd_used_ratio=$((100 * hdd_used_space / hddGigaBytes))
hdd_data_free1Kblocks=$(($(zpool list -pH | awk '{print $4}') / 1024))
hddUsedInfo="${hdd_used_space} (${hdd_used_ratio}%)"
else