diff --git a/pdc-bulk-reset-password.sh b/pdc-bulk-reset-password.sh index a65c09a..8219ae7 100755 --- a/pdc-bulk-reset-password.sh +++ b/pdc-bulk-reset-password.sh @@ -33,6 +33,12 @@ while IFS="" read -r p || [ -n "$p" ]; do continue fi + # Check if $USERNAME starts with a number + if [[ $USERNAME =~ ^[0-9] ]]; then + echo "Username cannot start with a number. Appending 'u' to the beginning of the username..." + USERNAME="u$USERNAME" + fi + # Check if user exists if ! samba-tool user show $USERNAME >/dev/null 2>&1; then echo "User $USERNAME do not exists"