2021-10-10 09:21:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-11-30 13:02:48 +00:00
|
|
|
set -u
|
|
|
|
set -e
|
|
|
|
|
2021-10-10 09:21:36 +00:00
|
|
|
ARGS="$*"
|
|
|
|
echo "Arguments: $ARGS"
|
|
|
|
|
2021-11-30 13:02:48 +00:00
|
|
|
EXT_UID=${EXT_UID:-999}
|
|
|
|
EXT_GID=${EXT_GID:-999}
|
|
|
|
|
2021-11-30 14:01:01 +00:00
|
|
|
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
|
|
|
|
groupadd -g "$EXT_GID" appuser
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
|
|
|
|
useradd -r -u "$EXT_UID" -g appuser appuser
|
|
|
|
fi
|
2021-11-30 13:02:48 +00:00
|
|
|
|
|
|
|
exec gosu appuser make "$@"
|