From 6b20dba53eb965c750a625a79739e37c77d92bca Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Sat, 18 Nov 2023 12:59:17 -0600 Subject: [PATCH] Began implementing timezone logic --- bare-arch-install.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/bare-arch-install.sh b/bare-arch-install.sh index 1d9e1c5..36847d1 100755 --- a/bare-arch-install.sh +++ b/bare-arch-install.sh @@ -92,6 +92,20 @@ get_answer () { } +get_timezones () { + local -n OUTPUT_VAR="${1:?"get_timezones: Output variable not provied"}" + local -a OPTIONS=( $( + cd /usr/share/zoneinfo + for DIR in $( ls -1 ); do + for ITEM in $DIR/*; do + echo "$DIR/$ITEM" + done + done + ) + ) + OUTER_VAR=$OPTIONS +} + # END: Helper Functions # BEGIN: Variables @@ -102,7 +116,6 @@ get_answer "What is the hostname of this machine?" HOSTNAME BOOT_METHOD="" get_choice "What is your boot method?" BOOT_METHOD BIOS EFI -exit DISK="${2:?"Disk was not provided"}" [[ ! -b $DISK ]] && { echo "Your disk ($DISK) does not exist. Please provide a valid one" @@ -114,10 +127,19 @@ SWAP_PARTITION=${DISK}2 ROOT_PARTITION=${DISK}3 ## New Login creds for your new user and the root user -ROOT_PASSWORD="root" -NEW_USER="username" -NEW_PASSWORD="password" +ROOT_PASSWORD="" +get_answer "What do you want the root password to be? : " ROOT_PASSWORD +NEW_USER="" +get_answer "What other user do you want to configure on the system? : " NEW_USER + +NEW_PASSWORD="password" +get_answer "What do you want the password for $NEW_USER to be? : " NEW_PASSWORD + +declare -a TIMEZONES +get_timezones TIMEZONES +echo "${TIMEZONES[@]}" +exit TIMEZONE_INFO=America/Chicago LOCALE=en_US.UTF-8