Spaces:
Sleeping
Sleeping
set -e | |
# Check if the user already exists | |
if id "$USER_ID" >/dev/null 2>&1; then | |
echo "User with ID $USER_ID already exists." | |
else | |
# Create a home directory for the user in the current working directory | |
mkdir -p "/app/home/user" | |
# Copy the contents of /etc/skel to the user's home directory | |
cp -r /etc/skel/* "/app/home/user/" | |
# Set ownership of the user's home directory | |
chown -R user:user "/app/home/user" | |
fi | |
# Run the CMD or any other command you want to execute | |
exec "$@" | |