Skip to content

Commit

Permalink
Add user only if it does not exist. (#1059)
Browse files Browse the repository at this point in the history
If user already exists, useradd ends with error and terminates the whole instalation process.
  • Loading branch information
budulinek authored and nachoparker committed Jan 19, 2020
1 parent 6359ca3 commit e0ae40b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ EOF
a2ensite ncp-activation

## NCP USER FOR AUTHENTICATION
useradd --home-dir /nonexistent "$WEBADMIN"
id -u "$WEBADMIN" &>/dev/null || useradd --home-dir /nonexistent "$WEBADMIN"
echo -e "$WEBPASSWD\n$WEBPASSWD" | passwd "$WEBADMIN"
chsh -s /usr/sbin/nologin "$WEBADMIN"

Expand Down

0 comments on commit e0ae40b

Please sign in to comment.