From 42909e3cfde3fa9b423ec4a09a50c2f1f4433eab Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Fri, 7 Jun 2024 23:49:37 +0200 Subject: [PATCH] add Administrator to user adding --- usr/lib/archboot/installer/configuration.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr/lib/archboot/installer/configuration.sh b/usr/lib/archboot/installer/configuration.sh index 6a9e3ccfe..ffe53ee38 100644 --- a/usr/lib/archboot/installer/configuration.sh +++ b/usr/lib/archboot/installer/configuration.sh @@ -172,14 +172,13 @@ _user_management() { _dialog --title " ERROR " --no-mouse --infobox "Username already exists! Please choose an other one." 3 60 sleep 3 else - _ADMIN_FLAG="" + _ADMIN_ATTR="" if _dialog --defaultno --yesno "Enable ${_USER} as Administrator and part of wheel group?" 5 60; then - _ADMIN_FLAG=1 + _ADMIN_ATTR="-G wheel" fi _set_comment || break _prepare_password User || break - if [[ -n "${_ADMIN_FLAG}" && "$(useradd -R "${_DESTDIR}" -G wheel -c "${_FN}" -m "${_USER}" &>"${_LOG}")" ]] ||\ - [[ -z "${_ADMIN_FLAG}" && "$(useradd -R "${_DESTDIR}" -c "${_FN}" -m "${_USER}" &>"${_LOG}")" ]]; then + if [[ "$(useradd -R "${_DESTDIR}" "${_ADMIN_ATTR}" -c "${_FN}" -m "${_USER}" &>"${_LOG}")" ]]; then _set_password _dialog --title " Success " --no-mouse --infobox "User Account ${_USER} created succesfully." 3 60 sleep 2