Correct issue with docker group being added to user.
This commit is contained in:
parent
fafdafa022
commit
811f61ddb4
6
setup.sh
6
setup.sh
@ -6,6 +6,7 @@
|
|||||||
# Variables
|
# Variables
|
||||||
timezone="America/New_York"
|
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() {
|
||||||
@ -48,6 +49,7 @@ install_docker() {
|
|||||||
systemctl start docker
|
systemctl start docker
|
||||||
systemctl enable docker
|
systemctl enable docker
|
||||||
echo "Docker installation complete."
|
echo "Docker installation complete."
|
||||||
|
docker_installed=true # Set the flag to true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to create a limited user account
|
# Function to create a limited user account
|
||||||
@ -64,8 +66,8 @@ create_user_account() {
|
|||||||
echo "$username:$password" | chpasswd
|
echo "$username:$password" | chpasswd
|
||||||
echo "User $username created and added to the wheel group."
|
echo "User $username created and added to the wheel group."
|
||||||
|
|
||||||
# Check if Docker is installed and add the user to the docker group
|
# Add the user to the docker group if Docker is installed
|
||||||
if command -v docker &> /dev/null; then
|
if [ "$docker_installed" = true ]; then
|
||||||
usermod -aG docker "$username"
|
usermod -aG docker "$username"
|
||||||
echo "User $username added to the docker group."
|
echo "User $username added to the docker group."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user