samba.sh derp
This commit is contained in:
parent
eb6c282bac
commit
2675311ab8
2
samba.sh
2
samba.sh
@ -126,7 +126,7 @@ smb() { local file=/etc/samba/smb.conf
|
|||||||
# Return: user added to container
|
# Return: user added to container
|
||||||
user() { local name="${1}" passwd="${2}" id="${3:-""}" group="${4:-""}"
|
user() { local name="${1}" passwd="${2}" id="${3:-""}" group="${4:-""}"
|
||||||
[[ "$group" ]] && { grep -q "^$group:" /etc/group || addgroup "$group"; }
|
[[ "$group" ]] && { grep -q "^$group:" /etc/group || addgroup "$group"; }
|
||||||
grep -q "^$user:" /etc/passwd ||
|
grep -q "^$name:" /etc/passwd ||
|
||||||
adduser -D -H ${group:+-G $group} ${id:+-u $id} "$name"
|
adduser -D -H ${group:+-G $group} ${id:+-u $id} "$name"
|
||||||
echo -e "$passwd\n$passwd" | smbpasswd -s -a "$name"
|
echo -e "$passwd\n$passwd" | smbpasswd -s -a "$name"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user