possibility to add more groups to the user

This commit is contained in:
BlubbFish 2021-08-17 12:51:23 +02:00
parent 5c4a95befe
commit 590d36b01c

View File

@ -4,7 +4,9 @@
usage() {
echo "usage: " \
"NAME=app " \
"CONFIGREPLACEASK=setting.conf params.conf"
"CONFIGREPLACEASK=setting.conf params.conf " \
"[MOREGROUPS=dialout " \
"DATADIR=/var/lib/data]"
"sh pre-post-build.sh"
exit 1
}
@ -25,7 +27,11 @@ echo ""
echo "if [ \"\$1\" = \"configure\" ]; then" >> postinst
echo " if [ -z \"\`id -u ${NAME}bot 2> /dev/null\`\" ]; then" >> postinst
echo " adduser --system --group --home /nonexistent --gecos \"${NAME} User\" --no-create-home --disabled-password --quiet ${NAME}bot || true" >> postinst
if [[ -z "$MOREGROUPS" ]]; then
echo " usermod -G ${NAME}bot,adm ${NAME}bot" >> postinst
else
echo " usermod -G ${NAME}bot,adm,${MOREGROUPS} ${NAME}bot" >> postinst
fi
echo " fi" >> postinst
echo "" >> postinst
for conffile in $CONFIGREPLACEASK ; do