Created
April 5, 2015 16:21
-
-
Save umhan35/4bb836b87bead5071af8 to your computer and use it in GitHub Desktop.
addnginxuser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addnginxuser() { | |
# creating nginx group if he isn't already there | |
if ! getent group nginx >/dev/null; then | |
addgroup --system nginx >/dev/null | |
fi | |
# creating nginx user if he isn't already there | |
if ! getent passwd nginx >/dev/null; then | |
adduser \ | |
--system \ | |
--disabled-login \ | |
--ingroup nginx \ | |
--no-create-home \ | |
--home /nonexistent \ | |
--gecos "nginx user" \ | |
--shell /bin/false \ | |
nginx >/dev/null | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment