Skip to content

Commit ec7994a

Browse files
author
teryanik
committed
Fix bug with "user already exists"
1 parent 1689ea3 commit ec7994a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/v-add-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ source $VESTA/func/main.sh
2222
source $VESTA/conf/vesta.conf
2323

2424
is_user_free() {
25-
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
25+
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep "^$user$" )
2626
if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then
2727
echo "Error: user $user exists"
2828
log_event "$E_EXISTS" "$EVENT"

0 commit comments

Comments
 (0)