diff --git a/bootstrap.sh b/bootstrap.sh index dfdec5d..e2a48d7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -11,21 +11,22 @@ done init() { [ -z "$NAME" ] && read -p "Hostname: " NAME - [ -z "$PASSWD" ] && while [ "$PASSWD" = "$CHECK"]; do - && read -sp "Root password: " PASSWD && read -sp "Repeat: " CHECK && + while [ -z "$PASSWD" ] || [ ! "$PASSWD" = "$CHECK" ]; do + read -sp "Root password: " PASSWD + read -sp "Repeat: " CHECK done # Show some possible disks - [ -z "$DEV" ] && lsblk -nrpo "name,size,model" && read -s "Provide installation medium (e.g. /dev/sda): " DEV - [[ "$DEV" =~ "sd[a-z]" ]] && SUF="1-3" && MODE="SATA" - [[ "$DEV" =~ "nvme[0-9]n[0-9]" ]] && SUF="p1-3" && MODE="NVME" + [ -z "$DEV" ] && lsblk -nrpo "name,size,model" && read -p "Provide installation medium (e.g. /dev/sda): " DEV + [[ "$DEV" =~ sd[a-z] ]] && SUF="1-3" && MODE="SATA" + [[ "$DEV" =~ nvme[0-9]n[0-9] ]] && SUF="p1-3" && MODE="NVME" echo "+---------------------+" echo "| Archlinux Bootstrap |" echo "+---------------------+" echo "HOSTNAME = $NAME" - echo "ROOTPASSWD = $PASSWD" + echo "ROOTPASSWD = ${PASSWD:0:1}***${PASSWD: -1}" echo "DEVICEPARTS = $DEV$SUF" - read -s "Do you want to continue with these values (y/n): " cont + read -p "Do you want to continue with these values (y/n): " cont [ ! "$cont" = "y" ] && unset NAME PASSWD DEV && init }