From d7aeffd9dd9181fd1d57fc0f8850324b061f723c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Mon, 25 Sep 2017 17:14:06 +0200 Subject: [PATCH] Remove home directory from ynh_system_user_create_smtp --- scripts/_common.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index dd4cc87..20a842e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,18 +4,11 @@ # # usage: ynh_system_user_create user_name [home_dir] # | arg: user_name - Name of the system user that will be create -# | arg: home_dir - Path of the home dir for the user. Usually the final path of the app. If this argument is omitted, the user will be created without home # | arg: password - user password (for SMTP access) ynh_system_user_create_smtp () { if ! ynh_system_user_exists "$1" # Check if the user exists on the system then # If the user doesn't exist - if [ $# -ge 2 ]; then # If a home dir is mentioned - user_home_dir="-d $2" - else - user_home_dir="--no-create-home" - fi - user_home_dir="-d $2" - sudo useradd $user_home_dir --system --user-group $1 --shell /bin/false || ynh_die "Unable to create $1 system account" + sudo useradd --no-create-home --system --user-group "$1" --shell /bin/false --password "$2" || ynh_die "Unable to create $1 system account" fi }