fix count + 1 bug

This commit is contained in:
CuttySark1869 2023-03-05 20:38:50 +00:00
parent 7d4bd18564
commit 0f5c2d8feb
1 changed files with 1 additions and 0 deletions

View File

@ -411,6 +411,7 @@ else #Skip truncate if input is device
fdiskresult=$(fdisk -l "$img")
count=$(tail -1 <<< "$fdiskresult" | tr -s ' ' | cut -d ' ' -f 3)
bs=$(head -3 <<< "$fdiskresult" | tail -1 | tr -s ' ' | rev | cut -d ' ' -f 2 | rev)
count=$(expr "$count" + 1)
dd if="$img" of="$target" bs="$bs" count="$count"
img="$target"
else