fix(bootstrap.sh): some minor bugs in init

master
Toerd@archlinux 5 years ago
parent 7c5565bb5f
commit 4febd10cb8

@ -11,21 +11,22 @@ done
init() { init() {
[ -z "$NAME" ] && read -p "Hostname: " NAME [ -z "$NAME" ] && read -p "Hostname: " NAME
[ -z "$PASSWD" ] && while [ "$PASSWD" = "$CHECK"]; do while [ -z "$PASSWD" ] || [ ! "$PASSWD" = "$CHECK" ]; do
&& read -sp "Root password: " PASSWD && read -sp "Repeat: " CHECK && read -sp "Root password: " PASSWD
read -sp "Repeat: " CHECK
done done
# Show some possible disks # Show some possible disks
[ -z "$DEV" ] && lsblk -nrpo "name,size,model" && read -s "Provide installation medium (e.g. /dev/sda): " DEV [ -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" =~ sd[a-z] ]] && SUF="1-3" && MODE="SATA"
[[ "$DEV" =~ "nvme[0-9]n[0-9]" ]] && SUF="p1-3" && MODE="NVME" [[ "$DEV" =~ nvme[0-9]n[0-9] ]] && SUF="p1-3" && MODE="NVME"
echo "+---------------------+" echo "+---------------------+"
echo "| Archlinux Bootstrap |" echo "| Archlinux Bootstrap |"
echo "+---------------------+" echo "+---------------------+"
echo "HOSTNAME = $NAME" echo "HOSTNAME = $NAME"
echo "ROOTPASSWD = $PASSWD" echo "ROOTPASSWD = ${PASSWD:0:1}***${PASSWD: -1}"
echo "DEVICEPARTS = $DEV$SUF" 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 [ ! "$cont" = "y" ] && unset NAME PASSWD DEV && init
} }

Loading…
Cancel
Save