mirror of
https://github.com/atmoz/sftp.git
synced 2025-03-09 15:16:00 -04:00
Precise grep pattern, skip function instead of exit
This commit is contained in:
parent
8bc91ed283
commit
0549dfa4af
1 changed files with 3 additions and 3 deletions
|
@ -37,9 +37,9 @@ function createUser() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $(cat /etc/passwd | cut -d: -f1 | grep -q "$user"); then
|
if $(cat /etc/passwd | cut -d: -f1 | grep -q "^$user:"); then
|
||||||
echo "FATAL: User \"$user\" already exists."
|
echo "WARNING: User \"$user\" already exists. Skipping."
|
||||||
exit 2
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
useraddOptions="--no-user-group"
|
useraddOptions="--no-user-group"
|
||||||
|
|
Loading…
Add table
Reference in a new issue