update archtitus

This commit is contained in:
Chris Titus 2024-08-22 19:54:40 -05:00
parent bb74ded264
commit bf0ce751e7

View File

@ -72,19 +72,12 @@ background_checks() {
docker_check
}
# Renders a text based list of options that can be selected by the
# user using up, down and enter keys and returns the chosen option.
#
# Arguments : list of options, maximum of 256
# "opt1" "opt2" ...
# Return value: selected index (0 for opt1, 1 for opt2 ...)
select_option() {
local options=("$@")
local num_options=${#options[@]}
local selected=0
while true; do
clear
echo "Please select an option using the arrow keys and Enter:"
for i in "${!options[@]}"; do
if [ $i -eq $selected ]; then
@ -243,11 +236,34 @@ drivessd
# @description Gather username and password to be used for installation.
userinfo () {
read -p "Please enter your username: " username
export USERNAME=${username,,} # convert to lower case as in issue #109
set_password "PASSWORD"
read -rep "Please enter your hostname: " nameofmachine
export NAME_OF_MACHINE=$nameofmachine
# Loop through user input until the user gives a valid username
while true
do
read -p "Please enter username:" username
if [[ "${username,,}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]]
then
break
fi
echo "Incorrect username."
done
export USERNAME=$username
# Loop through user input until the user gives a valid hostname, but allow the user to force save
while true
do
read -p "Please name your machine:" name_of_machine
# hostname regex (!!couldn't find spec for computer name!!)
if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]]
then
break
fi
# if validation fails allow the user to force saving of the hostname
read -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force
if [[ "${force,,}" = "y" ]]
then
break
fi
done
export NAME_OF_MACHINE=$name_of_machine
}
# Starting functions
@ -273,7 +289,7 @@ iso=$(curl -4 ifconfig.co/country-iso)
timedatectl set-ntp true
pacman -S --noconfirm archlinux-keyring #update keyrings to latest to prevent packages failing to install
pacman -S --noconfirm --needed pacman-contrib terminus-font
setfont ter-v22b
setfont ter-v18b
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
pacman -S --noconfirm --needed reflector rsync grub
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
@ -519,35 +535,6 @@ elif grep -E "Integrated Graphics Controller" <<< ${gpu_type}; then
elif grep -E "Intel Corporation UHD" <<< ${gpu_type}; then
pacman -S --needed --noconfirm libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa
fi
# Loop through user input until the user gives a valid username
while true
do
read -p "Please enter username:" USERNAME
if [[ "${username,,}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]]
then
break
fi
echo "Incorrect username."
done
read -p "Please enter password:" PASSWORD
# Loop through user input until the user gives a valid hostname, but allow the user to force save
while true
do
read -p "Please name your machine:" name_of_machine
# hostname regex (!!couldn't find spec for computer name!!)
if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]]
then
break
fi
# if validation fails allow the user to force saving of the hostname
read -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force
if [[ "${force,,}" = "y" ]]
then
break
fi
done
echo -ne "
-------------------------------------------------------------------------