From 0549dfa4afa681a56c05d5b39a8c5efb99eb7131 Mon Sep 17 00:00:00 2001 From: Adrian Dvergsdal Date: Sun, 11 Sep 2016 01:05:01 +0200 Subject: [PATCH] Precise grep pattern, skip function instead of exit --- entrypoint | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint b/entrypoint index 991b03b..d7d869d 100755 --- a/entrypoint +++ b/entrypoint @@ -37,9 +37,9 @@ function createUser() { exit 1 fi - if $(cat /etc/passwd | cut -d: -f1 | grep -q "$user"); then - echo "FATAL: User \"$user\" already exists." - exit 2 + if $(cat /etc/passwd | cut -d: -f1 | grep -q "^$user:"); then + echo "WARNING: User \"$user\" already exists. Skipping." + return 0 fi useraddOptions="--no-user-group"