From 5c622466b85435e289427076c8c9b38fea4b767e Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 17 Nov 2019 15:51:26 +0100 Subject: Condition if there is no existing parts --- joes-arch-install-UEFI.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/joes-arch-install-UEFI.sh b/joes-arch-install-UEFI.sh index d932b38..7410479 100755 --- a/joes-arch-install-UEFI.sh +++ b/joes-arch-install-UEFI.sh @@ -366,14 +366,16 @@ echo "\ #=================================#" echo && echo basepartc=$(lsblk "$drv" | grep -c part) -i=1 -while [[ $i -le $basepartc ]]; do - towhipe=$(lsblk "$drv" | grep part | awk '{print $1}' | rev | cut -c -1 | rev | awk "NR==$i") - dd if=/dev/zero of="$drv$towhipe" bs=1M status=progress - ((i++)) -done -echo "Whiping disk. This step may take a while." -dd if=/dev/zero of="$drv" bs=1M status=progress +if [ $basepartc -ge 1 ]; then + i=1 + echo "Whiping disk. This step may take a while." + while [[ $i -le $basepartc ]]; do + towhipe=$(lsblk "$drv" | grep part | awk '{print $1}' | rev | cut -c -1 | rev | awk "NR==$i") + dd if=/dev/zero of="$drv$towhipe" bs=1M status=progress > /dev/null + ((i++)) + done +fi +dd if=/dev/zero of="$drv" bs=1M status=progress > /dev/null wipefs --all --force "$drv" fdisk "$drv" << FDISK_INPUT o @@ -433,7 +435,8 @@ clear echo "\ #====== IV. INSTALLING LINUX =====# # # -# 4. Installing base packages # +# 4. Downloading base packages # +# (about 300M) # # # # Please be patient, # # this may take a while # @@ -447,7 +450,7 @@ clear echo "\ #====== IV. INSTALLING LINUX =====# # # -# 4.5 Installing some extras # +# 4.5 Downloading some extras # # # # Please be patient, # # this may take a while # -- cgit v1.2.3