File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
89EXECAPP=" ${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.
5860if [ ! -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
6966else
7067 # If WORKDIR is not defined, use its HOME
7168 WORKDIR=$( getent passwd $USERNAME | awk -F: ' {print $(NF-1)}' )
You can’t perform that action at this time.
0 commit comments