mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
ec764b7c08
svn path=/nixos/trunk/; revision=7171
20 lines
387 B
Bash
20 lines
387 B
Bash
userExists() {
|
|
local name="$1"
|
|
if id -u "$name" > /dev/null 2>&1; then
|
|
return 0 # true
|
|
else
|
|
return 1 # false
|
|
fi
|
|
}
|
|
|
|
|
|
createUser() {
|
|
local name="$1"
|
|
local password="$2"
|
|
local uid="$3"
|
|
local gid="$4"
|
|
local gecos="$5"
|
|
local homedir="$6"
|
|
local shell="$7"
|
|
echo "$name:$password:$uid:$gid:$gecos:$homedir:$shell" >> /etc/passwd
|
|
}
|