Speed_Read_AI / entrypoint.sh
circulartext's picture
Update entrypoint.sh
9ae4f84
raw
history blame
519 Bytes
#!/bin/bash
# Get the username from the command line arguments
USERNAME=$1
# Check if the user already exists
if id "$USERNAME" >/dev/null 2>&1; then
echo "User $USERNAME already exists."
else
# Create the user with a home directory and a bash shell
useradd -m -s /bin/bash "$USERNAME"
fi
# Set appropriate permissions for the application directory
chown -R "$USERNAME":"$USERNAME" /app
chmod -R 755 /app
# Switch to the user for improved security
su "$USERNAME" -c "exec /usr/local/bin/entrypoint.sh"