Skip to content

Commit aff2545

Browse files
committed
Adjusted minor details regarding entrypoint syntax.
1 parent e4a4f55 commit aff2545

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

entrypoint.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#==============================================#
66

77
# Executable to which cl arguments should fit
8-
INTERP="${ENTRYPOINT-'echo'}"
8+
EXECAPP="${EXECAPP:-'/bin/bash'}"
99

1010
# Save the input cl arguments
1111
DARGS="$*"
@@ -33,25 +33,25 @@ function config_user()
3333
# nothing to be done here
3434
return 0
3535

36-
DUSER="${DUSER-$DEFAULT_USER}"
37-
DUID="${DUID-$DEFAULT_UID}"
38-
DGID="${DGID-$DEFAULT_GID}"
36+
DUSER="${DUSER:-$DEFAULT_USER}"
37+
DUID="${DUID:-$DEFAULT_UID}"
38+
DGID="${DGID:-$DEFAULT_GID}"
3939

4040
useradd -u "$DUID" \
4141
-g "$DGID" \
4242
-d "/home/$DUSER" -m \
4343
-s /bin/bash \
4444
"$DUSER"
4545

46-
echo $DUSER
46+
echo "$DUSER"
4747
}
4848

4949

5050
# Add a user here
5151
USERNAME=$(config_user)
5252

5353
# If no user created, define the current one (root)
54-
[[ `id $USERNAME` ]] || USERNAME="$USER"
54+
[[ `id "$USERNAME"` ]] || USERNAME="$USER"
5555

5656
# Garantee the user will run on a proper place.
5757
# WORKDIR is the dir where the user will run from.
@@ -71,7 +71,5 @@ else
7171
WORKDIR=$(getent passwd $USERNAME | awk -F: '{print $(NF-1)}')
7272
fi
7373

74-
su -l $USERNAME -c "cd $WORKDIR && $INTERP $DARGS"
75-
76-
#!/bin/bash -e
74+
su -l $USERNAME -c "cd $WORKDIR && $EXECAPP $DARGS"
7775

0 commit comments

Comments
 (0)