Compare commits
1 Commits
master
...
enhancemen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd5aef79ff |
14
setup.sh
14
setup.sh
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user