File size: 417 Bytes
ad11504
3068f36
6bb32f9
8f503f3
 
 
ee9ae6d
 
 
 
8f503f3
ad11504
ee9ae6d
 
7d78cfc
ad11504
7d78cfc
ad11504
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -e

# Use the USER_ID environment variable or default to 1000
USER_ID=${USER_ID:-1000}

# Check if the user already exists
if id "$USER_ID" >/dev/null 2>&1; then
  echo "User with ID $USER_ID already exists."
else
  echo "Creating user with ID $USER_ID."
  # Create a new user with the specified ID
  useradd -m -u "$USER_ID" user
fi

# Run the CMD or any other command you want to execute
exec "$@"