debian-mirror-gitlab/debian/adduser.sh

21 lines
759 B
Bash
Raw Normal View History

2015-09-24 12:14:52 +05:30
#!/bin/sh
2016-02-18 13:02:28 +05:30
# add gitlab user (requires adduser >= 3.34)
2015-09-24 12:14:52 +05:30
# don't muck around with this unless you KNOW what you're doing
2016-02-18 13:02:28 +05:30
# Take gitlab_user from envornment variable or use gitlab
test -n "${gitlab_user}" || gitlab_user="gitlab"
2018-10-13 18:00:29 +05:30
# Take gitlab_data_dir from envornment variable or use /var/lib/gitlab
test -n "${gitlab_data_dir}" || gitlab_data_dir="/var/lib/gitlab"
2016-02-18 13:02:28 +05:30
# Create gitlab user with home in /var/lib
echo "Creating/updating ${gitlab_user} user account..."
adduser --system --home /var/lib/gitlab --gecos "${gitlab_user} user" --shell /bin/sh \
2016-08-15 14:29:01 +05:30
--quiet --disabled-password --group ${gitlab_user} || {
2016-02-18 13:02:28 +05:30
echo "Proceeding with existing ${gitlab_user} user..."
2015-09-24 12:14:52 +05:30
}
# Give gitlab_user ownership of gitlab_data_dir
chown ${gitlab_user} ${gitlab_data_dir}