From: hayao Date: Sat, 29 Feb 2020 06:43:03 +0000 (+0900) Subject: [fix] : Set user-created defaults. X-Git-Tag: 20Q1.2.0~29^2~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=eccf44216860162de28be1b44d28126dec18410a;p=alterlinux%2Falterlinux.git [fix] : Set user-created defaults. --- diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index 2f59270b..de8fa2b1 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -49,6 +49,8 @@ sed -i 's/^#\s*\(%sudo\s\+ALL=(ALL)\s\+ALL\)/\1/' /etc/sudoers function create_user () { local _password local _username + _password=${password} + _username=alter # Option analysis while getopts 'p:u:' arg; do @@ -58,11 +60,6 @@ function create_user () { esac done - # User name is empty - [[ -z "${_username}" ]] && echo "User name is empty" >&2; exit 1 - [[ -z "${_password}" ]] && echo "User password is empty" >&2; exit 1 - - useradd -m -s /bin/bash ${_username} groupadd sudo usermod -G sudo ${_username} @@ -70,6 +67,7 @@ function create_user () { chmod 700 -R /home/${_username} chown ${_username}:${_username} -R /home/${_username} echo -e "${_password}\n${_password}" | passwd ${_username} + set -u } create_user -u alter -p "${password}"