diff --git a/DiskSetup.sh b/DiskSetup.sh index b2f504b..b705288 100755 --- a/DiskSetup.sh +++ b/DiskSetup.sh @@ -197,18 +197,12 @@ function CarveBare { } function CleanChrootDiskPrtTbl { - local HAS_PARTS local PART_NUM local PDEV - HAS_PARTS="$( - parted -s "${CHROOTDEV}" print | \ - sed -e '1,/^Number/d' \ - -e '/^$/d' - )" - # Ensure there's actually partitions to clear - if [[ -z ${HAS_PARTS:-} ]] + # Exit if there's no VTOC to clear + if [[ $( parted -s "${CHROOTDEV}" print > /dev/null 2>&1 )$? -ne 0 ]] then echo "Disk has no partitions to clear" return