Spaces:
Sleeping
Sleeping
circulartext
commited on
Commit
•
8f503f3
1
Parent(s):
dab8551
Update entrypoint.sh
Browse files- entrypoint.sh +4 -0
entrypoint.sh
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
#!/bin/bash
|
2 |
set -e
|
3 |
|
|
|
|
|
|
|
4 |
# Check if the user already exists
|
5 |
if id "$USER_ID" >/dev/null 2>&1; then
|
6 |
echo "User with ID $USER_ID already exists."
|
7 |
else
|
|
|
8 |
# Create a new user with the specified ID
|
9 |
useradd -m -u "$USER_ID" user
|
10 |
fi
|
|
|
1 |
#!/bin/bash
|
2 |
set -e
|
3 |
|
4 |
+
# Use the USER_ID environment variable or default to 1000
|
5 |
+
USER_ID=${USER_ID:-1000}
|
6 |
+
|
7 |
# Check if the user already exists
|
8 |
if id "$USER_ID" >/dev/null 2>&1; then
|
9 |
echo "User with ID $USER_ID already exists."
|
10 |
else
|
11 |
+
echo "Creating user with ID $USER_ID."
|
12 |
# Create a new user with the specified ID
|
13 |
useradd -m -u "$USER_ID" user
|
14 |
fi
|