From f07f9d553fc9d58acb9cd8b59fe88523807c1ed8 Mon Sep 17 00:00:00 2001 From: Patrick Double Date: Wed, 5 Aug 2015 11:03:05 -0500 Subject: [PATCH] Handle case of EUID or EGID not set --- init/11_new_user.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/11_new_user.sh b/init/11_new_user.sh index b5ac305..9d0cf40 100644 --- a/init/11_new_user.sh +++ b/init/11_new_user.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ "$(id -u abc)" != "$PUID" ]; then usermod -o -u "$PUID" abc ; fi -if [ "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi +if [ -n "$PUID" -a "$(id -u abc)" != "$PUID" ]; then usermod -o -u "$PUID" abc ; fi +if [ -n "$PGID" -a "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi echo " -----------------------------------