Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbudulinek <budulinek@users.noreply.github.com>2020-01-19 05:22:57 +0300
committernachoparker <nacho@ownyourbits.com>2020-01-19 05:22:57 +0300
commite0ae40b8dbaeabbbe57fcb85dd8f6975216227e9 (patch)
treeead0be62a564630731ea10cc9ba7f1f30fc788dd
parent6359ca307d3a1412c2b29fa9a9e69575ca4a4974 (diff)
Add user only if it does not exist. (#1059)v1.20.4
If user already exists, useradd ends with error and terminates the whole instalation process.
-rw-r--r--ncp.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/ncp.sh b/ncp.sh
index 69db9872..4e532c9e 100644
--- a/ncp.sh
+++ b/ncp.sh
@@ -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"