You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
726 B
33 lines
726 B
#!/bin/sh |
|
set -e |
|
. /usr/share/debconf/confmodule |
|
|
|
db_get composer/WEB_USER || true |
|
WEB_USER=$(echo $RET | awk -F: '{print $1}') |
|
|
|
|
|
db_get composer/WEB_GROUP || true |
|
WEB_GROUP=$RET |
|
if [ -z ${WEB_GROUP} ]; then |
|
WEB_GROUP=${WEB_USER} |
|
fi |
|
|
|
# creating WEB User group if it isn't already there |
|
if ! getent group ${WEB_GROUP} >/dev/null; then |
|
addgroup --system --force-badname --quiet ${WEB_GROUP} |
|
fi |
|
|
|
# creating web user if it isn't already there |
|
if ! getent passwd $WEB_USER >/dev/null; then |
|
adduser --system --force-badname --quiet \ |
|
--ingroup ${WEB_GROUP} \ |
|
--home /var/www --no-create-home \ |
|
--shell /bin/false \ |
|
${WEB_USER} |
|
usermod -c "Web Data" $WEB_SERVER |
|
fi |
|
|
|
export WEB_USER |
|
export WEB_GROUP |
|
|
|
|
|
|