possibility to add more groups to the user
This commit is contained in:
parent
5c4a95befe
commit
590d36b01c
@ -4,7 +4,9 @@
|
|||||||
usage() {
|
usage() {
|
||||||
echo "usage: " \
|
echo "usage: " \
|
||||||
"NAME=app " \
|
"NAME=app " \
|
||||||
"CONFIGREPLACEASK=setting.conf params.conf"
|
"CONFIGREPLACEASK=setting.conf params.conf " \
|
||||||
|
"[MOREGROUPS=dialout " \
|
||||||
|
"DATADIR=/var/lib/data]"
|
||||||
"sh pre-post-build.sh"
|
"sh pre-post-build.sh"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -25,7 +27,11 @@ echo ""
|
|||||||
echo "if [ \"\$1\" = \"configure\" ]; then" >> postinst
|
echo "if [ \"\$1\" = \"configure\" ]; then" >> postinst
|
||||||
echo " if [ -z \"\`id -u ${NAME}bot 2> /dev/null\`\" ]; 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
|
echo " adduser --system --group --home /nonexistent --gecos \"${NAME} User\" --no-create-home --disabled-password --quiet ${NAME}bot || true" >> postinst
|
||||||
echo " usermod -G ${NAME}bot,adm ${NAME}bot" >> 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 " fi" >> postinst
|
||||||
echo "" >> postinst
|
echo "" >> postinst
|
||||||
for conffile in $CONFIGREPLACEASK ; do
|
for conffile in $CONFIGREPLACEASK ; do
|
||||||
|
Loading…
Reference in New Issue
Block a user