Append u
This commit is contained in:
parent
cabeaafab5
commit
53bc27a6f4
|
@ -33,6 +33,12 @@ while IFS="" read -r p || [ -n "$p" ]; do
|
||||||
continue
|
continue
|
||||||
fi
|
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
|
# Check if user exists
|
||||||
if ! samba-tool user show $USERNAME >/dev/null 2>&1; then
|
if ! samba-tool user show $USERNAME >/dev/null 2>&1; then
|
||||||
echo "User $USERNAME do not exists"
|
echo "User $USERNAME do not exists"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user