diff options
author | Simon Rettberg | 2015-05-21 17:13:32 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-05-21 17:13:32 +0200 |
commit | 1a7e54bb0eebc1432ba2b025754d2cd9065c4686 (patch) | |
tree | 9b75e982d3a00ed0cf2c4cf8df73e43836082a40 /satellit_installer/includes/10-handle_users.inc | |
parent | [SSPS] Add www-data to adm group (diff) | |
download | setup-scripts-1a7e54bb0eebc1432ba2b025754d2cd9065c4686.tar.gz setup-scripts-1a7e54bb0eebc1432ba2b025754d2cd9065c4686.tar.xz setup-scripts-1a7e54bb0eebc1432ba2b025754d2cd9065c4686.zip |
[SSPS] Error abort for user management functions
Diffstat (limited to 'satellit_installer/includes/10-handle_users.inc')
-rw-r--r-- | satellit_installer/includes/10-handle_users.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/satellit_installer/includes/10-handle_users.inc b/satellit_installer/includes/10-handle_users.inc index c273713..9d46b92 100644 --- a/satellit_installer/includes/10-handle_users.inc +++ b/satellit_installer/includes/10-handle_users.inc @@ -1,26 +1,26 @@ add_group() { echo -n "# Adding group: $1, gid $2..." - groupadd -g "$2" "$1" 2>/dev/null || echo "Could not add group $1 / gid $2!" + groupadd -g "$2" "$1" 2>/dev/null || perror "Could not add group $1 / gid $2!" echo " ok." } add_user() { echo -n "# Adding user: $1, uid $2, to gid $3..." useradd -u "$2" -m -d /home/"$1" -s /bin/bash -g "$3" "$1" 2>/dev/null \ - || echo "Could not add user ${1}/${2} / gid $3!" + || perror "Could not add user ${1}/${2} / gid $3!" echo " ok." } add_user_nohome() { echo -n "# Adding homeless user: $1, uid $2, to gid $3..." useradd -u "$2" --no-create-home --shell /bin/false -g "$3" "$1" 2>/dev/null \ - || echo "Could not add homeless user ${1}/${2} / gid $3!" + || perror "Could not add homeless user ${1}/${2} / gid $3!" echo " ok." } kill_user() { echo -n "# Terminating user account id $1, leaving user home/files as they were: " - userdel $(getent passwd "$1" | cut -f 1 -d ":") || echo "# could not kill userid ${1}!" + userdel $(getent passwd "$1" | cut -f 1 -d ":") || perror "# could not kill userid ${1}!" echo " ok." } |