From 87b3c9b2118d7813e7ba5e13b70aa661a51a1cd4 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Fri, 22 Oct 2021 15:34:38 -0400 Subject: [PATCH] Fix script-user-add --- script-install-manual-scripts | 2 +- script-user-add | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/script-install-manual-scripts b/script-install-manual-scripts index 6741ad95..e54783ef 100755 --- a/script-install-manual-scripts +++ b/script-install-manual-scripts @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script will add scripts-* to the PATH +# This script will add scripts-* to the PATH and the manual to each user's Desktop # Copyright 2021 Bryan C. Roessler [[ -f functions ]] && . functions || exit 1 diff --git a/script-user-add b/script-user-add index 2033c985..2cbdd9ad 100755 --- a/script-user-add +++ b/script-user-add @@ -14,6 +14,11 @@ echo "$@" useradd_cmd=("useradd" "-m" "-U") +if id -u "$username"; then + ask_ok "User $username exists. Run script-user-remove?" || exit $? + script-user-remove "$username" +fi + ask_ok "Create user $username with password $password?" || exit $? restore="no"