mirror of
https://gitlab.com/prism7/archery.git
synced 2026-04-28 01:17:35 +02:00
Add: The installer now checks for bad username and wll not continue unless a valid username has been set.
Change: A few prompts have been edited/added for better aesthetics. Change: User input at the 'Multiboot Status' stage now defaults to lowercase. Change: Minor code changes for simplification.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
# Amelia Installer
|
||||
# Source: https://gitlab.com/prism7/archery
|
||||
# Version: 9.7.0
|
||||
# Version: 9.7.1
|
||||
|
||||
set -euo pipefail
|
||||
###################################################################################################
|
||||
@@ -690,7 +690,7 @@ Enter a number: "
|
||||
###################################################################################################
|
||||
slct_locale() {
|
||||
|
||||
local prompt="Locale"
|
||||
local prompt="Locale Selection"
|
||||
sleep 0.2
|
||||
NC "
|
||||
|
||||
@@ -744,7 +744,7 @@ Enter your Locale ${bwhite}(empty for 'en_US')${blue}: "
|
||||
###################################################################################################
|
||||
slct_kbd() {
|
||||
|
||||
local prompt="Keyboard Layout"
|
||||
local prompt="Keyboard Layout Selection"
|
||||
local stage_prompt="Setting Keyboard Layout"
|
||||
sleep 0.2
|
||||
NC "
|
||||
@@ -808,7 +808,7 @@ Enter your keyboard layout ${bwhite}(empty for 'us')${blue}: "
|
||||
###################################################################################################
|
||||
user_setup() {
|
||||
|
||||
local prompt="User"
|
||||
local prompt="User Setup"
|
||||
sleep 0.2
|
||||
NC "
|
||||
|
||||
@@ -832,7 +832,7 @@ Enter a username: "
|
||||
---------------------------------------------"
|
||||
reload
|
||||
return 1
|
||||
fi
|
||||
elif [[ "${USERNAME}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]]; then
|
||||
|
||||
BLUE "
|
||||
Enter a password for${nc} ${cyan}${USERNAME}${blue}: "
|
||||
@@ -840,15 +840,15 @@ Enter a password for${nc} ${cyan}${USERNAME}${blue}: "
|
||||
==> " USERPASSWD
|
||||
echo
|
||||
|
||||
if [[ -z "${USERPASSWD}" ]]; then
|
||||
sleep 0.2
|
||||
RED "
|
||||
if [[ -z "${USERPASSWD}" ]]; then
|
||||
sleep 0.2
|
||||
RED "
|
||||
---------------------------------------------
|
||||
### ${yellow}Please enter a password to continue ${red}###
|
||||
---------------------------------------------"
|
||||
reload
|
||||
return 1
|
||||
fi
|
||||
reload
|
||||
return 1
|
||||
fi
|
||||
|
||||
BLUE "
|
||||
Re-enter${nc} ${cyan}${USERNAME}'s ${blue}password: "
|
||||
@@ -856,11 +856,20 @@ Re-enter${nc} ${cyan}${USERNAME}'s ${blue}password: "
|
||||
==> " USERPASSWD2
|
||||
echo
|
||||
|
||||
if [[ "${USERPASSWD}" != "${USERPASSWD2}" ]]; then
|
||||
if [[ "${USERPASSWD}" != "${USERPASSWD2}" ]]; then
|
||||
sleep 0.2
|
||||
RED "
|
||||
---------------------------------------------------
|
||||
### ${yellow}Passwords don't match. Please try again.. ${red}###
|
||||
---------------------------------------------------"
|
||||
reload
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
sleep 0.2
|
||||
RED "
|
||||
---------------------------------------------------
|
||||
### ${yellow}Passwords don't match. Please try again.. ${red}###
|
||||
### ${yellow}Please enter a valid username to continue ${red}###
|
||||
---------------------------------------------------"
|
||||
reload
|
||||
return 1
|
||||
@@ -870,7 +879,7 @@ Re-enter${nc} ${cyan}${USERNAME}'s ${blue}password: "
|
||||
###################################################################################################
|
||||
rootuser_setup() {
|
||||
|
||||
local prompt="Root User"
|
||||
local prompt="Root User Setup"
|
||||
sleep 0.2
|
||||
NC "
|
||||
|
||||
@@ -914,7 +923,7 @@ Re-enter${nc} ${cyan}Root ${blue}user's password: "
|
||||
###################################################################################################
|
||||
slct_hostname() {
|
||||
|
||||
local prompt="Hostname"
|
||||
local prompt="Hostname Setup"
|
||||
sleep 0.2
|
||||
NC "
|
||||
|
||||
@@ -950,7 +959,7 @@ Enter a hostname: "
|
||||
###################################################################################################
|
||||
slct_shell() {
|
||||
|
||||
local prompt="Shell"
|
||||
local prompt="Shell Selection"
|
||||
sleep 0.2
|
||||
NC "
|
||||
|
||||
@@ -3468,7 +3477,6 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Multi
|
||||
|
||||
|
||||
|
||||
|
||||
### If ${nc}'(y)es'${yellow} then: "
|
||||
CYAN "
|
||||
|
||||
@@ -3486,6 +3494,8 @@ Enter [y/n]: "
|
||||
read -r -p "
|
||||
==> " multibooting
|
||||
|
||||
multibooting="${multibooting,,}"
|
||||
|
||||
case "${multibooting}" in
|
||||
y)
|
||||
sleep 0.2
|
||||
@@ -3647,7 +3657,6 @@ Enter a disk number ${bwhite}(empty to skip)${blue}: "
|
||||
until manual_presets; do : ; done
|
||||
until set_partsize; do : ; done
|
||||
until partitioner; do : ; done
|
||||
return 0
|
||||
else
|
||||
invalid
|
||||
return 1
|
||||
@@ -3854,9 +3863,7 @@ partitioner() {
|
||||
if [[ "${install}" == "yes" ]]; then
|
||||
until sanity_check; do : ; done
|
||||
else
|
||||
if [[ -n "${preset}" ]]; then
|
||||
ok
|
||||
fi
|
||||
ok
|
||||
fi
|
||||
}
|
||||
###################################################################################################
|
||||
@@ -3968,6 +3975,7 @@ Enter a disk number: "
|
||||
-----------------------------------"
|
||||
reload
|
||||
until main_menu; do : ; done
|
||||
return 0
|
||||
fi
|
||||
volumes="$(fdisk -l | grep '^/dev' | cat --number)"
|
||||
rota="$(lsblk "${instl_drive}" --nodeps --noheadings --output=rota | awk "{print \$1}")"
|
||||
@@ -4002,6 +4010,7 @@ Enter a disk number: "
|
||||
until ask_multibooting; do : ; done
|
||||
fi
|
||||
until sanity_check; do : ; done
|
||||
return 0
|
||||
else
|
||||
invalid
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user