Remove docker_installed variable, add prompt for time zone.

This commit is contained in:
Nick Hepler 2024-10-14 21:42:15 -04:00
parent e9e19af507
commit cd5aef79ff

View File

@ -4,15 +4,21 @@
# add a limited user account, modify sshd_config settings, and optionally install Docker CE
# Variables
timezone="America/New_York"
sshd_config="/etc/ssh/sshd_config"
docker_installed=false
# Function to prompt for hostname
prompt_for_hostname() {
read -p "Please enter the desired hostname: " hostname
}
# Function to prompt for timezone selection
prompt_for_timezone() {
echo "Available timezones:"
timedatectl list-timezones
read -p "Please enter the desired timezone (default: America/New_York): " timezone
timezone=${timezone:-"America/New_York"} # Default to America/New_York if no input
}
# Function to add hostname and IP to /etc/hosts
update_hosts_file() {
local ip_address
@ -52,7 +58,6 @@ install_docker() {
usermod -aG docker "$username"
echo "User $username added to the docker group."
}
# Function to create a limited user account
@ -96,6 +101,9 @@ elif command -v yum &> /dev/null; then
yum -y update
fi
# Prompt for timezone selection
prompt_for_timezone
# Change the timezone
echo "Setting timezone to $timezone..."
timedatectl set-timezone "$timezone"