Compare commits
1 Commits
master
...
enhancemen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd5aef79ff |
16
setup.sh
16
setup.sh
@ -4,15 +4,21 @@
|
|||||||
# add a limited user account, modify sshd_config settings, and optionally install Docker CE
|
# add a limited user account, modify sshd_config settings, and optionally install Docker CE
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
timezone="America/New_York"
|
|
||||||
sshd_config="/etc/ssh/sshd_config"
|
sshd_config="/etc/ssh/sshd_config"
|
||||||
docker_installed=false
|
|
||||||
|
|
||||||
# Function to prompt for hostname
|
# Function to prompt for hostname
|
||||||
prompt_for_hostname() {
|
prompt_for_hostname() {
|
||||||
read -p "Please enter the desired hostname: " 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
|
# Function to add hostname and IP to /etc/hosts
|
||||||
update_hosts_file() {
|
update_hosts_file() {
|
||||||
local ip_address
|
local ip_address
|
||||||
@ -52,7 +58,6 @@ install_docker() {
|
|||||||
|
|
||||||
usermod -aG docker "$username"
|
usermod -aG docker "$username"
|
||||||
echo "User $username added to the docker group."
|
echo "User $username added to the docker group."
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to create a limited user account
|
# Function to create a limited user account
|
||||||
@ -96,6 +101,9 @@ elif command -v yum &> /dev/null; then
|
|||||||
yum -y update
|
yum -y update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Prompt for timezone selection
|
||||||
|
prompt_for_timezone
|
||||||
|
|
||||||
# Change the timezone
|
# Change the timezone
|
||||||
echo "Setting timezone to $timezone..."
|
echo "Setting timezone to $timezone..."
|
||||||
timedatectl set-timezone "$timezone"
|
timedatectl set-timezone "$timezone"
|
||||||
@ -167,4 +175,4 @@ elif command -v yum &> /dev/null; then
|
|||||||
yum -y autoremove
|
yum -y autoremove
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "System update complete! Timezone set to $timezone, hostname set to $hostname, limited user created, sshd_config modified, and Docker installation completed if selected."
|
echo "System update complete! Timezone set to $timezone, hostname set to $hostname, limited user created, sshd_config modified, and Docker installation completed if selected."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user