File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
1111DARGS=" $* "
@@ -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
5151USERNAME=$( 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.
7171 WORKDIR=$( getent passwd $USERNAME | awk -F: ' {print $(NF-1)}' )
7272fi
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
You can’t perform that action at this time.
0 commit comments