File size: 508 Bytes
80db73d
2a51fee
45e3447
dfd32bf
 
2a51fee
dfd32bf
dca556b
 
90b2859
 
dca556b
90b2859
 
dca556b
87aacc5
5783142
2a51fee
80db73d
90b2859
dca556b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
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 "$@"