From dccba0420c2a8d6edf9585ad5dbdf21e793f10db Mon Sep 17 00:00:00 2001 From: Matt C Date: Thu, 3 Mar 2022 16:10:05 -0500 Subject: [PATCH] loop while invalid disk --- citrine.internal.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/citrine.internal.sh b/citrine.internal.sh index 8fa8347..5c59202 100755 --- a/citrine.internal.sh +++ b/citrine.internal.sh @@ -63,24 +63,28 @@ yesno "Would you like to partition manually?" echo "PMODE=$yn" PMODE="$yn" -dumptitle="System Disks" -diskdat="$(fdisk -l | grep Disk | grep sectors --color=never | grep -v loop)" -dump "$diskdat" - -MANUAL="no" -DISK="" if [[ "$PMODE" == "0" ]]; then MANUAL="yes" -else +fi + +DONE="no" + +while [[ "$DONE" == "no" ]]; do + dumptitle="System Disks" + diskdat="$(fdisk -l | grep Disk | grep sectors --color=never | grep -v loop)" + dump "$diskdat" + + MANUAL="no" + DISK="" msgbox "Install target WILL BE FULLY WIPED" echo "DISK=$msgdat" DISK="$msgdat" - if ! fdisk -l ${DISK}; then - dumptitle="ERROR" - dump "Seems like $DISK doesn't exist. Did you typo?" - exit 1 + if fdisk -l ${DISK}; then + DONE="yes" fi -fi +done + + if [[ $DISK == *"nvme"* ]]; then inf "Seems like this is an NVME disk. Noting"