Kaynağa Gözat

Fix bug with "user already exists"

teryanik 10 yıl önce
ebeveyn
işleme
ec7994a402
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      bin/v-add-user

+ 1 - 1
bin/v-add-user

@@ -22,7 +22,7 @@ source $VESTA/func/main.sh
 source $VESTA/conf/vesta.conf
 source $VESTA/conf/vesta.conf
 
 
 is_user_free() {
 is_user_free() {
-    check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
+    check_sysuser=$(cut -f 1 -d : /etc/passwd | grep "^$user$" )
     if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then
     if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then
         echo "Error: user $user exists"
         echo "Error: user $user exists"
         log_event "$E_EXISTS" "$EVENT"
         log_event "$E_EXISTS" "$EVENT"