Skip to content

Commit 5c665e8

Browse files
committed
Fixed merging conflicts.
Merge branch 'master' of github.com:chbrandt/docker_commons Conflicts: entrypoint.sh
2 parents aff2545 + b82d8e6 commit 5c665e8

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

entrypoint.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Script to support the initialization process #
44
# in a docker container. #
55
#==============================================#
6+
#set -xv
67

78
# Executable to which cl arguments should fit
89
EXECAPP="${EXECAPP:-'/bin/bash'}"
@@ -41,9 +42,10 @@ function config_user()
4142
-g "$DGID" \
4243
-d "/home/$DUSER" -m \
4344
-s /bin/bash \
44-
"$DUSER"
45+
"$DUSER" || return 1
4546

4647
echo "$DUSER"
48+
return 0
4749
}
4850

4951

@@ -57,15 +59,10 @@ USERNAME=$(config_user)
5759
# WORKDIR is the dir where the user will run from.
5860
if [ ! -z "$WORKDIR" ]; then
5961
# If WORKDIR is defined, verify the permissions
60-
if [ -d "$WORKDIR" ]; then
61-
if [ ! -w "$WORKDIR" ]; then
62-
chown -R ${USERNAME}: $WORKDIR
63-
chmod 755 $WORKDIR
64-
fi
65-
else
62+
if [ ! -d "$WORKDIR" ]; then
6663
mkdir -p $WORKDIR
67-
chown ${USERNAME}: $WORKDIR
6864
fi
65+
chown -R ${USERNAME}: $WORKDIR
6966
else
7067
# If WORKDIR is not defined, use its HOME
7168
WORKDIR=$(getent passwd $USERNAME | awk -F: '{print $(NF-1)}')

0 commit comments

Comments
 (0)