Add error output.
This commit is contained in:
parent
5b64969bd2
commit
40c1e6b335
@ -74,7 +74,14 @@ if ! id -u "${user_name}" > /dev/null 2>&1 ; then
|
|||||||
|
|
||||||
# - Add user to system
|
# - Add user to system
|
||||||
# -
|
# -
|
||||||
echo "$user_name:${password}:${user_uid}:${user_gid}:${user_name},,,:${home_dir}:/bin/bash" | newusers
|
echo "$user_name:${password}:${user_uid}:${user_gid}:${user_name},,,:${home_dir}:/bin/bash" | newusers >/dev/null 2>&1
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo ""
|
||||||
|
echo -e " [ \033[31m\033[1mFatal\033[m ] Adding user \033[1m${user_name}\033[m failed!"
|
||||||
|
echo -e " Script terminated.."
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d "$skel_dir" ]]; then
|
if [[ -d "$skel_dir" ]]; then
|
||||||
cp -a "${skel_dir}/.bash_logout" "${home_dir}/"
|
cp -a "${skel_dir}/.bash_logout" "${home_dir}/"
|
||||||
|
Loading…
Reference in New Issue
Block a user